ajwah_bloc library

Classes

Action<T>
In Action<T> generic T used for pauload.
Actions
used for making effects applying filters on action type(s). [...]
BaseEffect
Every effect class must derived from BaseEffect 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') [...]
BaseState<T>
Every state class must derived from BaseState<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

createStore({List<BaseState> states, List<BaseEffect> effects: const [] }) Store
This is the entry point of the ajwah store. You may pass necessay states and effects through this method. Also you can dynamically add or remove state and effect using addState(BaseState stateInstance) ,removeStateByStateName(String stateName), addEffects(BaseEffect effectInstance), addEffect(EffectCallback callback, {@required String key}), removeEffectsByKey(String key)
dispatch(String actionType, [ dynamic payload ]) Store
This is a helper function of store().dispatch(Action action).
select<T>(String stateName) → Observable<T>
This is a helper function of store().select(String stateName). [...]
select2<T>(T callback(Map<String, dynamic> state)) → Observable<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. [...]
store() Store
return Store instance.

Typedefs

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