Closed code-forger closed 10 months ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 3fc48eabc118b4556cd88acbc48cf1f34c6a3837:
Sandbox | Source |
---|---|
quick-install | Configuration |
fetchye-provider-install | Configuration |
fetchye-redux-provider-install | Configuration |
nextjs-fetchye-ssr | Configuration |
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