Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BetterIpcRenderer on method only gets called once #42

Open
MasterGordon opened this issue Oct 21, 2021 · 6 comments
Open

BetterIpcRenderer on method only gets called once #42

MasterGordon opened this issue Oct 21, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@MasterGordon
Copy link

As the title says the on method of electron-better-ipcs ipcRenderer only gets called once and the original on get called every time a message is sent.

// Renderer
ipcRenderer.on("channel", console.log)

// Main
ipcMain.sendToRenderers("channel", "test")
ipcMain.sendToRenderers("channel", "test")

This example only logs once with the better ipc one and twice with the vanilla version

@sindresorhus
Copy link
Owner

Can you confirm you're on version 2.0.1? Because a similar issue was fixed in 2.0.1: fdda864

@MasterGordon
Copy link
Author

Yes I am running on version 2.0.1
If I downgrade to 2.0.0 it doesn't even get called once

@sindresorhus
Copy link
Owner

// @t13m In case you have any idea what might cause this.

@sindresorhus sindresorhus added the bug Something isn't working label Oct 21, 2021
@t13m
Copy link
Contributor

t13m commented Oct 29, 2021

Have no idea yet, but I'll try to dig in a little bit, will update later when i find something

@t13m
Copy link
Contributor

t13m commented Oct 29, 2021

@MasterGordon Hi, I tried in electron fiddle with v13.1.7, and no luck to reproduce this problem, the message correctly shows twice.

@MasterGordon
Copy link
Author

@t13m I will try to create a repo for reproduction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants