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
function waitSingleWidgetInVirtualTree( | |
options: MacroApiOptions, | |
scope: ScopeItem[] = [], | |
callback: ( | |
(error: Error | null, virtualTreeNode: VirtualTreeNode | null) => void | |
) | |
) { | |
let unsubscribeFromStore: (() => void) | null = null; | |
function stopWaitingSingleWidgetInVirtualTree() { | |
if (unsubscribeFromStore) { |
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
// In Renderer | |
export function makeHttpRequest(url: string; method: string) { | |
return createIpcSender<{ url: string; method: string }, void>( | |
'http-request', | |
{ url, method }, | |
); | |
} | |
// ... in browser window code ... | |
makeHttpRequest('https://httpbin.org', 'GET').subscribe({ |
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
export function replaceVars( | |
content: string, | |
variables: { [key: string]: string } | |
) { | |
const varRegex = /\$([a-z0-9_]*)/gi; | |
let match: RegExpExecArray; | |
while ((match = varRegex.exec(content)!)) { | |
let [wholeVar, varName] = match; |
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
-- COMING SOON |
OlderNewer