-
Notifications
You must be signed in to change notification settings - Fork 215
onInit does not triggers state change #8
New issue
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
Comments
Hey hey, thanks so much for the detailed report. You're not doing anything wrong, but you have found a bug!!! :) You should definitely be able to dispatch either sync or async actions freely from within the I've written a test case for this bug and verified it's failing. I've got a fix in the works and I'll push it up soon! Thanks again. |
This allows users to dispatch sync actions within the onInit function. Fixes #8
New package published as 0.3.5 with this bugfix :) |
@driveddy Just to confirm, did this bugfix work for ya? |
@brianegan Yes like a charm. Thanks you so much for your quick fix!! ❤ |
Hey @brianegan
first of all thanks for the awesome library!!!
I noticed the following:
Im having an app state
requestLessonState
which is on app launchnull
.onInit
I would like to dispatch an action to assignrequestLessonState
a value, in this casefalse
. The action get dispatched as expected and the state changed to the expected value. BUT the view model get generated before the state changed. So for me it is not possible to basically create an init value for the model.Is this an issue or an expected behaviour (something async or so)? If it is an expected behaviour, do you something in mind to solve this "issue"?
I hope you can help me some how or push me in the right direction.
Thanks in advance
Imagine the following setup
Main App State
Sub App State
Widget
My View Model
Action
Reducer
The text was updated successfully, but these errors were encountered: