CAF
posterus
CAF | posterus | |
---|---|---|
9 | 3 | |
1,323 | 549 | |
- | - | |
0.0 | 0.0 | |
over 1 year ago | almost 3 years ago | |
JavaScript | JavaScript | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
CAF
-
What Is The Best Name for This Synchronous Function?
Consumer vs. Producer - "Redux Saga is said to be about managing side effects..." I'm not sure this description is a million miles from what you're trying to achieve (although I'm struggling a little to comprehend) Redux Saga is essentially a set of APIs around yield that goes quite far in doing what you describe: Making the consumer of a chain of a/synchronous tasks more in control of the flow. Also worth your consideration might be Cancelable Async Flows.
-
Why would anyone need JavaScript generator functions?
The absolute best use case for generator functions is for making cancellable async flows: https://github.com/getify/CAF
-
AbortController is your friend
Here is link number 1 - Previous text "CAF"
-
Effection: for when async/await is not enough
To that end, CAF tries to create a more ergonomic/idiomatic way of doing this "threading" of cancelation semantics through your async tasks. Perhaps it's worth a glance: https://github.com/getify/CAF
-
What's a really simple way to make code "time out" it it takes too long?
there are some libs offering something similar: https://github.com/getify/CAF
- Cancelable Async Flows (CAF) by Kyle Simpson
-
How to Timeout a Promise
May I suggest looking at CAF?
posterus
-
Cluster friendly task scheduler for NodeJS
Check out these; - https://github.com/mitranim/posterus - https://github.com/timgit/pg-boss - https://github.com/FirebaseExtended/firebase-queue - https://www.npmjs.com/package/rabbit-queue
-
I Avoid Async/Await
Async/Await covers the 80% of use cases for async logic in JS. Most people aren't really using promises as multicast references. They don't call `then` in one place, hang on to the promise reference, then call `then` again somewhere else (perhaps to represent a cached value); they call `then` once on the reference because it's just a moment in a composite operation.
It's for this reason that I think this library[0] is the more appropriate abstraction for that same 80% of use-cases, as its more memory efficient since you can represent the same composite operation that generates multiple promise references with a single object (a unicast reference instead). I haven't learned Rust but apparently the author bases this on Rust's ownership principle.
[0]https://github.com/mitranim/posterus
-
What is one thing you find annoying about react and are surprised it hasn't been addressed yet?
https://github.com/mitranim/posterus#taskdeinit
What are some alternatives?
fasy - FP iterators that are both eager and asynchronous
Fluture - 🦋 Fantasy Land compliant (monadic) alternative to Promises
modern-async - A modern JavaScript tooling library for asynchronous operations using async/await, promises and async generators
Immer - Create the next immutable state by mutating the current one
promiviz - Visualize JavaScript Promises on the browser. Visualize the JavaScript Promise APIs and learn. It is a playground to learn about promises faster, ever!
firebase-queue
redux-promise-middleware - Enables simple, yet robust handling of async action creators in Redux
React - The library for web and native user interfaces.
p-map - Map over promises concurrently
redux-saga - An alternative side effect model for Redux apps
bigtest - Ensure your React/Vue/Ember/anything app works perfectly across browsers.
boxed - Essential building-blocks for functional & safe TypeScript code