feat(oneFetchye): make even cleaner api for fetchtye #90
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.
Description
Create a new, cleaner, way of imperatively calling fetchye in One App
Motivation and Context
requiring callers to use
makeOneServerFetchye
is both messy, and incredibly confusing, since this function works in the client too.Since redux's
dispatch
must always be in scope formakeOneServerFetchye
to be called, this function can be transformed to a thunk generator.That takes this code:
To this code:
in all relevant contexts.
NOTE: This does not change the api at all, all params that the imperative
fetchye
made bymakeOneServerFetchye
took, the thunk generator still takes. You can still await the dispatch, to get back into your hand the exact returned value as before.This is purely syntactic sugar.
How Has This Been Tested?
Unit tests, run in a tenancy
Types of Changes
Checklist:
What is the Impact to Developers Using Fetchye?
Simpler API