diff options
-rw-r--r-- | src/lustre/event.gleam | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lustre/event.gleam b/src/lustre/event.gleam index 451d598..f1c1fb3 100644 --- a/src/lustre/event.gleam +++ b/src/lustre/event.gleam @@ -9,6 +9,12 @@ pub fn on (name: String, handler: fn (Dynamic, fn (action) -> Nil) -> Nil) -> At attribute.event(name, handler) } +pub fn dispatch (action: action) -> fn (fn (action) -> Nil) -> Nil { + fn (dispatch) { + dispatch(action) + } +} + // MOUSE EVENTS ---------------------------------------------------------------- |