File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ Then install with Spago:
3131Whether you are using the hook or one of the component helpers, the main feature that Halo provides is the ` eval ` function. It looks like:
3232
3333``` purescript
34- Lifecycle props action -> HaloM props state action m a
34+ Lifecycle props action -> HaloM props state action m Unit
3535```
3636
3737where ` Lifecycle ` is:
@@ -55,7 +55,12 @@ hoist :: forall props state action m m'. Functor m => (m ~> m') -> HaloM props s
5555Example:
5656
5757``` purescript
58- invertReaderT x = ReaderT \env -> Halo.hoist (flip runReaderT env) x
58+ -- Inverting a reader
59+ hoistReaderT ::
60+ forall props state action env m.
61+ HaloM props state action (ReaderT env m) ~>
62+ ReaderT env (HaloM props state action m)
63+ hoistReaderT x = ReaderT \env -> Halo.hoist (flip runReaderT env) x
5964```
6065
6166### Working with props
@@ -67,9 +72,14 @@ props :: forall props action state m. HaloM props state action m props
6772Example:
6873
6974``` purescript
70- fireOnChange value = do
75+ fireOnChange ::
76+ forall props state action m a.
77+ MonadEffect m =>
78+ HaloM { onChange :: a -> Effect Unit | props } { value :: a | state } action m Unit
79+ fireOnChange = do
7180 { onChange } <- Halo.props
72- onChange value
81+ { value } <- Halo.get
82+ liftEffect (onChange value)
7383```
7484
7585### Working with state
You can’t perform that action at this time.
0 commit comments