ajwah_bloc library

Classes

Action<T>
In Action<T> generic T used for pauload action.
Actions
used for making effects applying filters on action type(s). [...]
AjwahStore
EffectBase
Every effect class must derived from EffectBase class. And it is optional to pass the effectKey. But it's mandatory if you want conditionally remove the effects by using store.removeEffectsByKey('effectKey') [...]
StateBase<T>
Every state class must derived from StateBase<T> class. And it is mandatory to pass the state name and initialState. [...]
Store
A comfortable way to develop reactive widgets. You can dynamically add or remove effects and states and many more.

Functions

addEffect(EffectCallback callback, {String effectKey}) → void
This method is usefull to add a single effect passing a callback ( Actions action$, Store store$)=>Stream and effectKey on demand. [...]
addEffects(EffectBase effectInstance) → void
This method is usefull to add effects passing effectInstance on demand.
addState(StateBase stateInstance) → void
This method is usefull to add a state passing stateInstance on demand.
createStore({List<StateBase> states, List<EffectBase> effects: const [], bool exposeApiGlobally: false}) Store
This is the entry point of the ajwah store. [...]
dispatcH(String actionType, [dynamic payload]) → void
This is a helper function of store.dispatcH(String actionType, dynamic payload).
dispatch(Action action) → void
This is a helper function of store.dispatch(Action action).
exportState() Stream<List>
return latest stream of action, state array. [...]
importState(Map<String, dynamic> state) → void
state object should be a Map<String, dynamic> state [...]
removeEffectsByKey(String effectKey) → void
This method is usefull to remove effects passing effectKey on demand.
removeStateByStateName(String stateName) → void
This method is usefull to remove a state passing stateName on demand.
select<T>(String stateName) Stream<T>
This is a helper function of store.select(String stateName). [...]
selectMany<T>(T callback(Map<String, dynamic> state)) Stream<T>
This method takes a callback which has a single Map<String, dynamic> type arg. If you pass Map key as a state name then you will get corresponding model instance as value. [...]
storeInstance() Store

Typedefs

EffectCallback(Actions action$, Store store$) Stream<Action>