mirror of
https://github.com/zaphar/sycamore-state.git
synced 2025-07-22 20:29:50 -04:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
6490d6db4d |
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "sycamore-state"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
@ -59,6 +59,15 @@ where
|
||||
self.dispatcher.map(cx, msg, self.signal)
|
||||
}
|
||||
|
||||
/// Directly handle a state message and then run a Fn.
|
||||
pub fn dispatch_and<F>(&'ctx self, cx: Scope<'ctx>, msg: Msg, f: F)
|
||||
where
|
||||
F: FnOnce(),
|
||||
{
|
||||
self.dispatch(cx, msg);
|
||||
f();
|
||||
}
|
||||
|
||||
/// Provides a ReadSignal handle for the contained Signal implementation.
|
||||
pub fn read_signal(&'ctx self) -> &'ctx ReadSignal<T> {
|
||||
self.signal
|
||||
|
Loading…
x
Reference in New Issue
Block a user