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

The disconnected method of yew_agent::worker::Worker be called on every render #3434

Closed
deftsp opened this issue Oct 1, 2023 · 0 comments · Fixed by #3435
Closed

The disconnected method of yew_agent::worker::Worker be called on every render #3434

deftsp opened this issue Oct 1, 2023 · 0 comments · Fixed by #3435
Labels

Comments

@deftsp
Copy link
Contributor

deftsp commented Oct 1, 2023

Problem

The disconnected method of yew_agent::worker::Worker be called on every render.

Steps To Reproduce

Here is the minimal example
yew_use_worker_bridge

keep pressing the "submit" button, the console of the browser will print

agent/event_bus connected: HandlerId(0)
worker.js:319 agent/event_bus connected: HandlerId(1)
worker.js:319 agent/event_bus disconnected: HandlerId(0)
worker.js:319 agent/event_bus disconnected: HandlerId(1)
worker.js:319 agent/event_bus disconnected: HandlerId(1)
worker.js:319 agent/event_bus disconnected: HandlerId(1)
worker.js:319 agent/event_bus disconnected: HandlerId(1)
worker.js:319 agent/event_bus disconnected: HandlerId(1)
worker.js:319 agent/event_bus disconnected: HandlerId(1)
......

Environment:

  • Yew version: [e.g. v0.21.0]
  • Build tool, if relevant: trunk]
  • OS, if relevant: [e.g. MacOS]
  • Browser and version, if relevant: [e.g. Chrome v117]
@deftsp deftsp added the bug label Oct 1, 2023
deftsp added a commit to deftsp/yew that referenced this issue Oct 2, 2023
hamza1311 pushed a commit that referenced this issue Oct 9, 2023
* Agent V2: fix #3434 by avoiding clone of WorkerBridge

* remove the Clone of WorkerProviderState
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant