Make api.save/load work with numbers rather than {value: number} #1
+6
−12
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.
Hello - running the example as is gives an error on loading.
api.save(...)
gets passed a number:redux-loop-ts-example/src/reducers/index.ts
Lines 43 to 47 in 00cc41c
redux-loop-ts-example/src/actions/index.ts
Lines 46 to 51 in 00cc41c
but expects a
Counter
:redux-loop-ts-example/src/api.ts
Lines 30 to 34 in 00cc41c
Similarly,
api.load()
resolves aCounter
:redux-loop-ts-example/src/api.ts
Lines 35 to 44 in 00cc41c
but the action expects a number:
redux-loop-ts-example/src/actions/index.ts
Lines 72 to 77 in 00cc41c
This then leads to the state shape being wrong, and the element refusing to render (Objects are not valid React children).
This commit gets rid of
Counter
and has the api just deal with numbers.