Factored out ipcRenderer.on
Summary: Delegate receiving events from the Electron host process to the RenderHost interface. Typed them as well while at it. Reviewed By: timur-valiev Differential Revision: D31828130 fbshipit-source-id: 920055de6f48512b91a433b229dbacd611c6f139
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cc946d12ec
commit
ecf2e32722
@@ -297,5 +297,10 @@ function initializeFlipperForElectron() {
|
||||
hasFocus() {
|
||||
return remote.getCurrentWindow().isFocused();
|
||||
},
|
||||
onIpcEvent(event, callback) {
|
||||
ipcRenderer.on(event, (_ev, ...args: any[]) => {
|
||||
callback(...(args as any));
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user