Closed wokket closed 4 years ago
@wokket in your Channel
component, the bridge is getting dropped so won't stay connected (see here: https://github.com/yewstack/yew/blob/master/src/agent.rs#L324)
Dropped here: https://github.com/wokket/diffcount-yew/blob/master/src/channel.rs#L54
Add it to your Channel
struct and you should be good to go 👍
Ahh, That makes sense, and is working perfectly now. Thanks for the quick help :)
Description
I'm submitting a Question
G'day guys,
I'm brand new to Yew (and pretty new to rust in general), and am having trouble getting eventing from a parent to it's children working. Hopefully this is a very simple misunderstanding on my part, as this has been very simple to throw together to this point :+1:
I have the code up here, and based on some earlier issue have written an intermediate agent to accept a 'Clear' message from the parent state component and forward a message to all the child Channel components requesting they clear their internal state.
Expected Results
I'd see a message appearing in each child Channel's update method sent from the agent.
Actual Results
The agent wire up appears to be ok,. and the parent is notifying the agent correctly. The agent logs indicate 14 subscribers (12 children + the parent + 1 magical subscriber?? not sure what's going on there) attached, with 12 (the children) being respondable.
Unfortunately the child channel logs are never hit, so the message has gone awry somewhere.
Total log output:
Context (Environment)
cargo-web: v0.6.26
Firefox V69.03