Implement Subscription::with

This commit is contained in:
Héctor Ramón Jiménez 2020-03-05 02:08:53 +01:00
parent 85ee2fc65a
commit a6531c840b
2 changed files with 77 additions and 6 deletions

View file

@ -77,8 +77,6 @@ impl Application for Launcher {
}
}
dbg!(self);
Command::none()
}
@ -88,11 +86,14 @@ impl Application for Launcher {
match example {
Example::Clock(clock) => clock
.subscription()
.map(move |message| Message::Clock(pane, message)),
.with(pane)
.map(|(pane, message)| Message::Clock(pane, message)),
Example::Stopwatch(stopwatch) => stopwatch
.subscription()
.map(move |message| Message::Stopwatch(pane, message)),
Example::Stopwatch(stopwatch) => {
stopwatch.subscription().with(pane).map(
|(pane, message)| Message::Stopwatch(pane, message),
)
}
}
}));