Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- peek :: forall a. H.ChildF ListSlot ListQueryP a -> H.ParentDSL State (ListStateP g) Query ListQueryP g ListSlot Unit
- peek = coproduct peekList peekTicker <<< H.runChildF
- peekList :: forall a. ListQuery a -> H.ParentDSL State (ListStateP g) Query ListQueryP g ListSlot Unit
- peekList _ =
- -- we're not actually interested in peeking on the list.
- -- instead of defining a function like this, an alternative would be to use
- -- `(const (pure unit))` in place of `peekList` in the `coproduct` function
- pure unit
- peekTicker :: forall a. H.ChildF TickSlot TickQuery a -> H.ParentDSL State (ListStateP g) Query ListQueryP g ListSlot Unit
- peekTicker (H.ChildF _ (Tick _)) = H.modify (st -> { count: st.count + 1 })
- peekTicker _ = pure unit
- peek = coproduct peekList (const (pure unit))
- peekList :: forall a. H.ChildF ListSlot ListQuery a -> H.ParentDSL State (ListStateP g) Query ListQueryP g ListSlot Unit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement