How to use the electron-better-ipc.ipcRenderer.callMain function in electron-better-ipc

To help you get started, we’ve selected a few electron-better-ipc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github garrylachman / ElectroCRUD / src / app / services / ipc / views.ipc.service.ts View on Github external
public async updateData(
    table: string, 
    update: IIPCUpdateDataUpdate, 
    where?: IIPCUpdateDataWhere[]
  ): Promise {
    const req: IPCUpdateDataRequestMessage = new IPCUpdateDataRequestMessage({
      table: table,
      update: update,
      where: where
    });
    console.log("req", req);
    const rawRes:any = await ipcRenderer.callMain(IPC_CHANNEL_UPDATE_DATA, req.toJsonValue());
    console.log("rawRes", rawRes);
    return new IPCUpdateDataResponseMessage(rawRes).toMessage()
  }
github wulkano / kap / renderer / containers / preferences.js View on Github external
updateShortcut = async (setting, shortcut) => {
    try {
      await ipc.callMain('update-shortcut', {setting, shortcut});
      this.setState({[setting]: shortcut});
    } catch (error) {
      console.warn('Error updating shortcut', error);
    }
  }
github garrylachman / ElectroCRUD / src / app / services / ipc / views.ipc.service.ts View on Github external
public async listOfTables(): Promise {
    const req: IPCListOfTablesRequestMessage = new IPCListOfTablesRequestMessage({});
    console.log("req", req);
    const rawRes:any = await ipcRenderer.callMain(IPC_CHANNEL_LIST_OF_TABLES, req.toJsonValue());
    console.log("rawRes", rawRes);
    return new IPCListOfTablesResponseMessage(rawRes).toMessage()
  }
github garrylachman / ElectroCRUD / src / app / services / ipc / accounts.service.ts View on Github external
public async checkConnection(account: IAccount): Promise {
    const req: IPCCheckConnectionRequestMessage = new IPCCheckConnectionRequestMessage({
      server: account.server,
      ssh: account.ssh
    });
    const rawRes:any = await ipcRenderer.callMain(IPC_CHANNEL_CHECK_CONNECTION, req.toJsonValue());
    console.log("rawRes", rawRes);
    return new IPCCheckConnectionResponseMessage(rawRes).toMessage()
  }
github npezza93 / archipelago / app / renderer / settings / profiles-drawer.jsx View on Github external
removeProfile(profileId) {
    ipc.callMain('remove-profile', profileId).then(({profiles, activeProfileId}) => {
      this.setState({profiles, activeProfileId})
    })
  }
github wulkano / kap / renderer / containers / editor.js View on Github external
startTime,
        endTime,
        isMuted
      },
      inputPath: originalFilePath || filePath,
      previewPath: filePath,
      plugin,
      serviceTitle,
      format,
      originalFps,
      isNewRecording,
      openWithApp
    };

    ipc.callMain('export', data);
    ipc.callMain('update-usage', {format, plugin: plugin.pluginName});
  }
}
github wulkano / kap / renderer / containers / editor.js View on Github external
saveOriginal = () => {
    const {filePath, originalFilePath} = this.state;
    ipc.callMain('save-original', {inputPath: originalFilePath || filePath});
  }
github wulkano / kap / renderer / pages / about.js View on Github external
componentDidUpdate() {
    ipc.callMain('about-ready');
  }
github wulkano / kap / renderer / containers / preferences.js View on Github external
toggleShortcuts = async () => {
    const setting = 'recordKeyboardShortcut';
    const newVal = !this.state[setting];
    this.toggleSetting(setting, newVal);
    await ipc.callMain('toggle-shortcuts', {enabled: newVal});
  }