Module

Dispatcher.React

Package
purescript-dispatcher-react
Repository
doolse/purescript-dispatcher-react

#getProps Source

getProps :: forall state props m. MonadEffect m => ReactReaderT props state m props

Get the React properties

#getState Source

getState :: forall state props m. MonadEffect m => ReactReaderT props state m state

Get the React state

#modifyState Source

modifyState :: forall state props m. MonadEffect m => (state -> state) -> ReactReaderT props state m Unit

Modify the React state

#ReactReaderT Source

type ReactReaderT props state m a = ReaderT (ReactThis props state) m a

The type of all React action handling functions

#renderer Source

renderer :: forall state props. ({ props :: props, state :: state } -> ReactElement) -> ReactThis props state -> Effect ReactElement

Create a render function using both props and state

#propsRenderer Source

propsRenderer :: forall state props. (props -> ReactElement) -> ReactThis props state -> Effect ReactElement

Create a render function using just the props

#stateRenderer Source

stateRenderer :: forall state props. (state -> ReactElement) -> ReactThis props state -> Effect ReactElement

Create a render function using just the state

#emptyHandler Source

emptyHandler :: forall m a. Applicative m => a -> m Unit

an empty event handler

#saveRef Source

saveRef :: forall ref. Ref (Maybe ref) -> EffectFn1 (Nullable ref) Unit

Save a React reference (DOM or Component) into a purescript mutable referance

#withRef Source

withRef :: forall m ref. MonadEffect m => Ref (Maybe ref) -> (ref -> m Unit) -> m Unit

Run an effect on the mutable reference if it's available