android-components / mozilla.components.lib.state / Store / <init>


Store(initialState: S, reducer: Reducer<S, A>, middleware: List<Middleware<S, A>> = emptyList())

A generic store holding an immutable State.

The State can only be modified by dispatching Actions which will create a new state and notify all registered Observers.


initialState - The initial state until a dispatched Action creates a new state.

reducer - A function that gets the current State and Action passed in and will return a new State.

middleware - Optional list of Middleware sitting between the Store and the Reducer.