-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add memletConfig option to makePluginIo
I'd much rather have a push strategy for this state, but the best I could achieve and test to work is a pulling strategy. The plugin factory will pull for the first instance.
- Loading branch information
Showing
7 changed files
with
73 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
import { EdgeOtherMethods } from 'edge-core-js/types' | ||
import { MemletConfig } from 'memlet' | ||
import { NativeModules } from 'react-native' | ||
// import { bridgifyObject, emit, onMethod } from 'yaob' | ||
|
||
const { EdgeCurrencyPluginsModule } = NativeModules | ||
const { sourceUri } = EdgeCurrencyPluginsModule.getConstants() | ||
|
||
export const pluginUri = sourceUri | ||
export const debugUri = 'http://localhost:8101/edge-currency-plugins.js' | ||
|
||
export function makePluginIo(): EdgeOtherMethods { | ||
return {} | ||
export interface EdgeCurrencyPluginIoOptions { | ||
readonly memletConfig?: MemletConfig | ||
} | ||
|
||
export interface EdgeCurrencyPluginNativeIo { | ||
readonly memletConfig?: MemletConfig | ||
readonly getMemletConfig: () => Promise<Partial<MemletConfig | undefined>> | ||
} | ||
|
||
export function makePluginIo( | ||
options: EdgeCurrencyPluginIoOptions = {} | ||
): EdgeCurrencyPluginNativeIo { | ||
const { memletConfig } = options | ||
|
||
return { | ||
memletConfig, | ||
getMemletConfig: async () => { | ||
return memletConfig | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters