ReduxStore<TState extends ReduxState> class
Redux PatternにおけるStoreを定義する. Storeは現在のステートと処理主体であるReducerを持つ.
Storeは配下に持つReducer等のライフサイクルも管理する. Store.dispose()されたタイミングでLifecycle.onDestroy()が実行され、 非同期処理等が逐次キャンセルされる.
- Available Extensions
Constructors
-
ReduxStore({required TState initial, ReduxStateDispose<
TState> ? stateDispose, ReduxStateEquals<TState> ? equals, Duration renderingInterval = const Duration(milliseconds: 1000 ~/ 60)}) -
指定された初期値でReduxStoreを生成する.
Stateの解放処理を明示的に記述したい場合、
stateDispose
を設定する.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
このStoreが破棄済みであるかどうかを取得する.
trueを返却するとき、もうActionを行うことはできない.
no setter
- isNotDisposed → bool
-
このStoreが有効である場合にtrueを返却する.
no setter
-
notifyEvent
→ Stream<
ReduxStateNotify< TState> > -
更新タイミングで付加情報を取得する.
no setter
-
renderStream
→ Stream<
TState> -
レンダリング用に流通量を制限したStreamを取得する.
stateStream は完全性を保証するが、このStreamはレンダリング用に間引きが行われるため、
完全性を保証しない.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → TState
-
現在のStateを取得する.
no setter
-
stateStream
→ Stream<
TState> -
StateをStreamとして取得する.
no setter
Methods
-
dispatch(
ReduxAction< TState> action) → void - Action実行をリクエストする.
-
dispatchAndResult(
ReduxAction< TState> action) → Future<TState> - Action実行をリクエストし、終了待ちのFuture
-
dispose(
) → Future - Storeの終了処理を行う
-
hasActions(
) → bool - 実行待ち、もしくは実行中のActionがあればtrueを返却する.
-
hasPendingActions(
) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
plugin<
TPlugin> () → TPlugin - 指定Pluginを取得する. 指定型のPluginが見つからない場合、このメソッドは例外を投げる.
-
pluginOrNull<
TPlugin> () → TPlugin? - 指定Pluginを取得する. 指定型のPluginが見つからない場合、このメソッドは例外を投げる.
-
registerPlugin(
ReduxPlugin< TState> plugin) → void - PluginをStoreへ登録する.
-
toString(
) → String -
A string representation of this object.
inherited
-
wherePlugin<
TPlugin> (bool test(ReduxPlugin< TState> element)) → TPlugin - 指定型と条件に一致するPluginを検索する
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited