ConanState
Last updated
Last updated
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
this method allows connecting all Conan state data with a React component,
this method allows connecting all Conan state with a React component
this method allows producing connected react elements by accepting a renderer function, which receives the ConanState data and actions.
this method can be uses to add a custom data reaction a un ConanState
this method returns the actions available for this ConanState
this method returns the current data of this ConanState
this method returns a filtered ConanState
this method returns a remapped ConanState
this method returns a remapped ConanState
this method combined two states into one
this method gives access to the async state data and actions
this method gives access to the state meta flow
this method combined two states into one
this method gives access to the ConanState main thread events
this method returns the ConantState name
this method allows to open a transaction
this method allows to close the current transaction
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
Input
toConnect
Type: React.ComponentType
required
the component type we want to connect
Returns
ReactElement
A connected React element
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
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
Input
Title
def
Type: DataReactionDef<DATA>
required
the custom data reaction definition
Returns
Title
DataReactionLock
TBC: Alberto que coño es esto
Input
Title
void
Returns
Title
DataReactionLock
actions available for this ConanState
Input
Title
void
Returns
Title
DATA
current data of this 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
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
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
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
Input
Title
void
Returns
Title
ConanState<MonitorInfo, MonitorActions>
the async state data and actions
Input
Title
void
Content
Returns
Title
ConanFlow<MetaStatuses, MetaMutators>
the meta Conan flow for this state
Input
Title
name
Type: String
required
The name for the combined ConanState that will be returned
fromState
Type: {[KEY in keyof T]: ConanState<T[KEY], any>}
required
the ConanState that we want to combine
pipeThreadDef
Type: PipeThreadDef<T, {}, ACTIONS>
optional
TBC: Alberto que coño es esto
Returns
Title
ConanState<T, ACTIONS>
The resulting combined ConanState
Input
Title
void
Returns
Title
FlowEventsTracker<{ nextData: DATA}>
all the events that have gone through the state main thread
Input
Title
void
Returns
Title
string
the ConanState name
Input
Title
name
Type: String
required
The name of the transaction to create to be used for internal logging only
Returns
Title
void
Input
Title
callback
Type: IConsumer<DATA>
optional
callback to be invoked once the transaction is closed
Returns
Title
void