Skip to content

Commit f1660eb

Browse files
committed
Some readme updates
1 parent 976eaea commit f1660eb

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Then install with Spago:
3131
Whether 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

3737
where `Lifecycle` is:
@@ -55,7 +55,12 @@ hoist :: forall props state action m m'. Functor m => (m ~> m') -> HaloM props s
5555
Example:
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
6772
Example:
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

0 commit comments

Comments
 (0)