STATE - the generic type of the client application's state.public interface Connector<STATE>
ReduxFXDevTool.connect(Connector) method.
There are many possible redux(like) implementations that may all be used with the DevTool. To connect one of these implementations with the DevTool a connector has to implement this interface. The connector has the responsibility to notify the DevTool about new dispatched actions and the state at this point in time and to replace the current state of the client application with a state defined by the DevTool to implement time-traveling.
| Modifier and Type | Method and Description |
|---|---|
void |
initActionPublisher(java.util.function.BiConsumer<java.lang.Object,STATE> actionPublisher)
This method is invoke a single time immediately after the connector is
connected to the DevTool (see
ReduxFXDevTool.connect(Connector). |
void |
pushState(STATE newState)
This method is invoked by the DevTool when a new state
is determined by the DevTool.
|
void pushState(STATE newState)
The connector implementation has to replace the state of the application with the state parameter passed to this method.
newState - the new state determined by the devtool.void initActionPublisher(java.util.function.BiConsumer<java.lang.Object,STATE> actionPublisher)
ReduxFXDevTool.connect(Connector).
The connector implementation has to use the actionPublisher passed to this method to tell the DevTool about new dispatched actions. The actionPublisher takes the dispatched action and the state at this point in time as arguments.
actionPublisher - a BiFunction that takes the dispatched
action as first argument and the state at this point in time
as the second parameter.