ConanState
The class ConanState contains the following methods:
connectMap <PROPS>
this method allows connecting a Conan state with a React component, using a mapper function to describe the mapping
Input | |
toConnect | Type: the component type we want to connect |
mapper | Type: A function that receives DATA and ACTIONS. It describes how the PROPS will be connected |
Returns | |
ReactElement | A connected React element |
connectData
this method allows connecting all Conan state data with a React component,
Input | |
toConnect | Type: the component type we want to connect |
Returns | |
ReactElement | A connected React element |
connect
this method allows connecting all Conan state with a React component
Input | Title |
toConnect | Type: the component type we want to connect |
Returns | Title |
ReactElement<ConnectedState> | A React element with the whole ConnectedState |
connectLive
this method allows producing connected react elements by accepting a renderer function, which receives the ConanState data and actions.
Input | Title |
renderer | Type: 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 |
addDataReaction
this method can be uses to add a custom data reaction a un ConanState
Input | Title |
def | Type: the custom data reaction definition |
Returns | Title |
DataReactionLock | TBC: Alberto que coño es esto |
do
this method returns the actions available for this ConanState
Input | Title |
void |
Returns | Title |
DataReactionLock | actions available for this ConanState |
getData
this method returns the current data of this ConanState
Input | Title |
void |
Returns | Title |
DATA | current data of this ConanState |
filter
this method returns a filtered ConanState
Input | Title |
mapper | Type:
|
Returns | Title |
ConanState<DATA> | The resulting filtered ConanState |
map<T>
this method returns a remapped ConanState
Input | Title |
mapper | Type:
|
Returns | Title |
ConanState<DATA> | The resulting remapped ConanState |
merge<T, TO_MERGE>
this method returns a remapped ConanState
Input | Title |
toMerge$ | Type:
|
merger | Type:
|
Returns | Title |
ConanState<T> | The resulting merged ConanState |
tuple<TO_MERGE>
this method combined two states into one
Input | Title |
toMerge$ | Type:
|
Returns | Title |
ConanState<[DATA, TO_MERGE]> | The resulting combined ConanState |
asyncState
this method gives access to the async state data and actions
Input | Title |
void |
Returns | Title |
ConanState<MonitorInfo, MonitorActions> | the async state data and actions |
metaFlow
this method gives access to the state meta flow
Input | Title |
void | Content |
Returns | Title |
ConanFlow<MetaStatuses, MetaMutators> | the meta Conan flow for this state |
combine<T extends {}, ACTIONS = void>
this method combined two states into one
Input | Title |
name | Type:
|
fromState | Type:
|
pipeThreadDef | Type:
|
Returns | Title |
ConanState<T, ACTIONS> | The resulting combined ConanState |
getEvents
this method gives access to the ConanState main thread events
Input | Title |
void |
Returns | Title |
FlowEventsTracker<{ nextData: DATA}> | all the events that have gone through the state main thread |
getName
this method returns the ConantState name
Input | Title |
void |
Returns | Title |
string | the ConanState name |
openTransaction
this method allows to open a transaction
Input | Title |
name | Type:
|
Returns | Title |
void |
closeTransaction
this method allows to close the current transaction
Input | Title |
callback | Type:
|
Returns | Title |
void |
Last updated