1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// use crate::event_bus::{EventBus, Request};
// use yew::agent::{Dispatched, Dispatcher};
// use yew::prelude::*;
// pub enum Msg {
// Clicked,
// }
// pub struct Producer {
// link: ComponentLink<Producer>,
// event_bus: Dispatcher<EventBus>,
// }
// impl Component for Producer {
// type Message = Msg;
// type Properties = ();
// fn create(_props: Self::Properties, link: ComponentLink<Self>) -> Self {
// Self {
// link,
// event_bus: EventBus::dispatcher(),
// }
// }
// fn change(&mut self, _props: Self::Properties) -> ShouldRender {
// false
// }
// fn update(&mut self, msg: Self::Message) -> ShouldRender {
// match msg {
// Msg::Clicked => {
// self.event_bus
// .send(Request::EventBusMsg("Message received".to_owned()));
// false
// }
// }
// }
// fn view(&self) -> Html {
// html! {
// <button onclick=self.link.callback(|_| Msg::Clicked)>
// { "PRESS ME" }
// </button>
// }
// }
// }