Put channels back in hook
This commit is contained in:
1 parent
fdce7bbe5a
commit
493b0693c5
1 file changed
+5
-3
@@ -69,9 +69,11 @@ where
|
|||||||
G: FnOnce(UnboundedReceiver<M>) -> F,
|
G: FnOnce(UnboundedReceiver<M>) -> F,
|
||||||
F: Future<Output = ()> + 'static,
|
F: Future<Output = ()> + 'static,
|
||||||
{
|
{
|
||||||
let (tx, rx) = futures_channel::mpsc::unbounded();
|
cx.use_hook(|| {
|
||||||
let task = cx.push_future(init(rx));
|
let (tx, rx) = futures_channel::mpsc::unbounded();
|
||||||
cx.use_hook(|| cx.provide_context(Coroutine { tx, task }))
|
let task = cx.push_future(init(rx));
|
||||||
|
cx.provide_context(Coroutine { tx, task })
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get a handle to a coroutine higher in the tree
|
/// Get a handle to a coroutine higher in the tree
|
||||||
|
|||||||
Reference in new issue
Block a user