A marionette
renderer for react-basic-hooks
. Provides an easy to use useMarionette
hook.
If you're using react-basic-hooks
but you like the way state is handled in halogen
components this library may be interesting for you.
- Module documentation is published on Pursuit.
spago install marionette spago install marionette-react-basic-hooks
spago install react-basic-hooks spago install react-basic-dom spago install react-basic
type State = Int type Msg = CountUp | Done control = case _ of CountUp -> do modify_ (_ + 1) liftAff $ delay (Milliseconds 1000.0) modify_ (_ + 1) sendMsg Done Done -> pure unit mkApp :: Component {} mkApp = component "App" \_ -> React.do state /\ act <- useMarionette { initialState: 0 , controller: mkController myControl } pure $ R.div' [ R.div' [ text $ show state ] , R.button { onClick: handler_ $ act CountUp } ]
You can run the examples in this repo with:
spago build yarn install
And then e.g.:
yarn parcel assets/CountDown.html