Package 

Class ScriptableMavericksStateStore

  • All Implemented Interfaces:
    com.airbnb.mvrx.MavericksStateStore , com.airbnb.mvrx.ScriptableStateStore

    
    public final class ScriptableMavericksStateStore<S extends Object>
     implements ScriptableStateStore<S>
                        

    A MavericksStateStore which ignores standard calls to set. Instead it can be scripted via calls to next. This is intended to be used for tests only, and in particular UI tests where you wish to test how your UI code reacts to different ViewModel states. This is not as useful for unit testing your view model, as business logic in state reducers will not be used.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private volatile S state
      private final Flow<S> flow
    • Method Summary

      Modifier and Type Method Description
      S getState()
      Unit setState(S state)
      Flow<S> getFlow()
      Unit get(Function1<S, Unit> block)
      Unit set(Function1<S, S> stateReducer)
      Unit next(S state) Force the current state to be moved to the given value immediately.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ScriptableMavericksStateStore

        ScriptableMavericksStateStore(S initialState)