Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding Flow types again, this time polymorphic so that we can define custom action types in the apps and make them type check correctly when using them with redux. Addresses #290
So far this only has the
createStore
typed, will work on the other util functions. Just wanted to show the progress so far and if anyone wants to chime in and give feedback, more than welcome!I have a temporary file in the counter example that is the actual one being type checked, instead of the real entry point (since I haven't yet typed the other util functions), which is
sample.js
. If you want to play around, uncommenting the lines there and runningflow
will correctly show the type errors.You may need to change the counter's
package.json
dependencies to makeredux
point tofile:../../
so that it grabs the code from the real source instead of npm (which doesn't have flow types yet).Caveat so far: There is a bug in Flow (facebook/flow#582) which forces us to explicitly specify the init action type inside the union list of the app's action types. Until that gets fixed, I'm afraid we'll need to keep doing that instead of having that type provided by
redux
itself, which is defined in theflow/types.js
file but not used.