public class FabricViewStateManager
extends java.lang.Object
Reason to use this: UpdateState calls from the View layer to the Fabric core can fail, and optionally Fabric will call a "failure callback" if that happens. This class abstracts that and makes it easier ensure that State in Fabric is always up-to-date.
1. Whenever ViewManager.updateState is called, call View.setStateWrapper. 2. Instead of calling StateWrapper.updateState directly, call View.setState and it will automatically keep retrying the UpdateState call until it succeeds; or you call setState again; or the View layer is updated with a newer StateWrapper.
Modifier and Type | Class and Description |
---|---|
static interface |
FabricViewStateManager.HasFabricViewStateManager |
static interface |
FabricViewStateManager.StateUpdateCallback |
Constructor and Description |
---|
FabricViewStateManager() |
Modifier and Type | Method and Description |
---|---|
ReadableMap |
getState() |
boolean |
hasStateWrapper() |
void |
setState(FabricViewStateManager.StateUpdateCallback stateUpdateCallback) |
void |
setStateWrapper(StateWrapper stateWrapper) |
public void setStateWrapper(StateWrapper stateWrapper)
public boolean hasStateWrapper()
public void setState(FabricViewStateManager.StateUpdateCallback stateUpdateCallback)
public ReadableMap getState()