ConanState
The class ConanState contains the following methods:
this method allows connecting a Conan state with a React component, using a mapper function to describe the mapping
Input | |
toConnect | Type: React.ComponentType required the component type we want to connect |
mapper | Type: IBiFunction<DATA, ACTIONS, PROPS> required A function that receives DATA and ACTIONS. It describes how the PROPS will be connected |
Returns | |
ReactElement | A connected React element |
this method allows connecting all Conan state data with a React component,
Input | |
toConnect | Type: React.ComponentType required the component type we want to connect |
Returns | |
ReactElement | A connected React element |
this method allows connecting all Conan state with a React component
Input | Title |
toConnect | Type: React.ComponentType<ConnectedState<DATA, ACTIONS>> required the component type we want to connect |
Returns | Title |
ReactElement<ConnectedState> | A React element with the whole ConnectedState |
this method allows producing connected react elements by accepting a renderer function, which receives the ConanState data and actions.
Input | Title |
renderer | Type: IBiFunction<DATA, ACTIONS, ReactElement | ReactElement[]> required The render function that will produce out connected react elements |
fallbackValue | Type: DATA optional default DATA in case nothing is there when initialised |
Returns | Title |
ReactElement | A State connected React element |
this method can be uses to add a custom data reaction a un ConanState
Input | Title |
def | Type: DataReactionDef<DATA> required the custom data reaction definition |
Returns | Title |
DataReactionLock | TBC: Alberto que coño es esto |
this method returns the actions available for this ConanState
Input | Title |
void | |
Returns | Title |
DataReactionLock | actions available for this ConanState |
this method returns the current data of this ConanState
Input | Title |
void | |
Returns | Title |
DATA | current data of this ConanState |
this method returns a filtered ConanState
Input | Title |
mapper | Type: (current: DATA, previous: DATA) => boolean required the filter function that receives the current and previous DATA and has to return a boolean |
Returns | Title |
ConanState<DATA> | The resulting filtered ConanState |
this method returns a remapped ConanState
Input | Title |
mapper | Type: IFunction<DATA, T> required the mapper function that receives the current DATA and has to return the new remmapped ConanState |
Returns | Title |
ConanState<DATA> | The resulting remapped ConanState |
this method returns a remapped ConanState
Input | Title |
toMerge$ | Type: ConanState<TO_MERGE, any> required the ConanState that we want to merge with |
merger | Type: ITriFunction<DATA, TO_MERGE, T, T> required the function that describes the merge operation |
Returns | Title |
ConanState<T> | The resulting merged ConanState |
this method combined two states into one
Input | Title |
toMerge$ | Type: ConanState<TO_MERGE, any> required the ConanState that we want to merge with |
Returns | Title |
ConanState<[DATA, TO_MERGE]> | The resulting combined ConanState |
this method gives access to the async state data and actions
Input | Title |
void |