-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add listener middleware Job class test file and initial usage test #1807
Conversation
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 3942f8f:
|
✔️ Deploy Preview for redux-starter-kit-docs ready! 🔨 Explore the source changes: 3942f8f 🔍 Inspect the deploy log: https://app.netlify.com/sites/redux-starter-kit-docs/deploys/61ac3768d0da65000808109f 😎 Browse the preview: https://deploy-preview-1807--redux-starter-kit-docs.netlify.app |
size-limit report 📦
|
6e7555a
to
3942f8f
Compare
I read your tweet about dropping jobs and using AbortController instead. I think it is doable moreover I think we could play a bit with async generators: I believe we should drop We are just increasing the cognitive load for no apparent benefit. I'm going to write a RFC in the other thread and a PR to drop this option. |
Hmm. I may not be fully understanding what you're suggesting about "async generators". I would prefer that this middleware not use generator functions, specifically because that's basically just reimplementing I think Lenz's concerns with jobs atm are a combination of bundle size and API size. Right now, I agree that there probably aren't as many reasons to run the listeners before the dispatched action. It would be a good idea to go review #237 and #547 to see why we decided to add that in the first place. I think part of it was because Lenz originally had that If you can do some research on why we added Also please feel free to try out something with I did see an interesting implementation at https://gist.github.com/andrewcourtice/ef1b8f14935b409cfe94901558ba5594 that looked like it might be a good starting point for something like that. |
This PR:
Job.pause()
to include the existing_cancelPromise
so that it bails out early if cancelation happens before the actual source promise resolvesjob.test.ts
file from the originaljob
library (and updates the assertions to work with Jest)