Module
Radox.React
- Package
- purescript-react-radox
- Repository
- danieljharvey/purescript-react-radox
Re-exports from Radox.React.Internal.Connect
#createRadoxContext Source
createRadoxContext :: forall state action. CombinedReducer action state -> state -> ReactRadoxContext action state
Takes a CombinedReducer and a default state, and returns both a root-level provider and connect component for using the Radox store
Re-exports from Radox.React.Internal.Consumer
#radoxConsumer Source
radoxConsumer :: forall state action localState props. Context (RadoxStore action state) -> ReactThis props localState -> ReactRadoxRenderMethod props state localState action -> Effect ReactElement
Internal function that creates a Purescript React class which allows consumption of the Radox store via React Context
Re-exports from Radox.React.Internal.Dispatcher
#DispatcherProps Source
type DispatcherProps = { action :: DispatcherEvent }
#DispatcherEvent Source
data DispatcherEvent
bit odd this - accessing context (in our case, the dispatch function from Radox) is not a thing you can comfortably do in React. Therefore, to fire a dispatch method from componentDidMount we use this component that renders nothing but fires whatever you like on first mount.
Constructors
Re-exports from Radox.React.Internal.Provider
#radoxProvider Source
radoxProvider :: forall state action. Context (RadoxStore action state) -> CombinedReducer action state -> state -> ReactClass { children :: Array ReactElement }
Internal function for creating a Purescript React class that providers the Radox store through React Context
Re-exports from Radox.React.Internal.Types
#ReactRadoxRenderMethod Source
type ReactRadoxRenderMethod props state localState action = { dispatch :: action -> Effect Unit, getState :: Effect state, localState :: localState, props :: props, state :: state } -> ReactElement
#ReactRadoxContext Source
type ReactRadoxContext action state = { consumer :: forall localState props. ReactThis props localState -> ReactRadoxRenderMethod props state localState action -> Effect ReactElement, provider :: ReactClass { children :: Array ReactElement } }