We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#43 这个里面有提到过,可以自定义provider 不过我觉得这个功能在app内还是挺常用的,所以后续可以考虑下加入。
The text was updated successfully, but these errors were encountered:
全局可以自定义一个单例的store,在这样的场景下 用Provider 似乎也没有任何好处。
Sorry, something went wrong.
@zjuwjf 请问如何全局定义一个单例的store,能给出具体代码吗?
类似于这样 @evelynEdison
class StoreUtil { static Store<AppState> _globalStore; static Store<AppState> get globalStore { if (_globalStore == null) { _globalStore = createStore<AppState>(AppState(), buildReducer()); } return _globalStore; } } class AppState implements Cloneable<AppState> { @override AppState clone() { // TODO: implement clone return null; } } Reducer<AppState> buildReducer() { return asReducer<AppState>(<Object, Reducer<AppState>>{ AppAction.request: _request, }); }
No branches or pull requests
#43 这个里面有提到过,可以自定义provider 不过我觉得这个功能在app内还是挺常用的,所以后续可以考虑下加入。
The text was updated successfully, but these errors were encountered: