electron-ipc-module
    Preparing search index...

    Function createIpcEmitter

    • Create a typed sender for events produced independently of an incoming IPC call, such as timers, file watchers, or background jobs.

      Pass the defineIpcModule register function to take the module's own resolved eventPrefix, so renaming it cannot leave the emitter sending to a channel the bridge no longer listens on. A literal string is still accepted for producers that have no module to point at.

      const registerProfile = defineIpcModule("profile", channels, { eventPrefix: true });
      const profile = createIpcEmitter<ProfileEvents>(registerProfile);

      Both methods drop the event when the target WebContents is already destroyed, and emitTo accepts a handler's event.sender without prefixing the channel a second time.

      Type Parameters

      Parameters

      Returns IpcEmitter<TEvents>