Comments (4)
This is one area that I feel pretty confident saying: users are not going to want to think about converting their promises into operations everytime they want to activate one inside a DC. It's not that much of a lift to support officially and the ergonomics make a ton of sense.
The bigger issue for me is supporting both safe and unsafe call()
functionality. I built a safe()
function that is the same as call()
but wraps the call inside a Result
type. This is extremely useful for cases where a user wants to run parallel operations and collect the results (e.g. starfx parallel
).
It works but integrating both into a single API seems better.
from effection.
This is one area that I feel pretty confident saying: users are not going to want to think about converting their promises into operations everytime they want to activate one inside a DC. It's not that much of a lift to support officially and the ergonomics make a ton of sense.
I agree, and our test cases we actually do this https://github.com/thefrontside/effection/blob/v3/test/suite.ts#L7-L16 However, I am very nervous about monkey-patching the global Promise
prototype.
Is opt-in going to be still too awkward? Maybe we make it opt-out?
It works but integrating both into a single API seems better.
How would we integrate this into a single call()
API since the type of the return value is of a different for safe calls?
from effection.
However, I am very nervous about monkey-patching the global Promise prototype.
Why do we need to monkey-patch? starfx
has call()
that supports promises oob. What about that don't you like?
from effection.
Oh, I thought you were saying we should be able to yield to promises
yield* someAsyncFunction();
vs
yield* call(someAsyncFunction());
from effection.
Related Issues (20)
- Add guide for using Context + Effects
- Finalize v3 docs HOT 1
- Determine order of operations for spawned code HOT 1
- Revisit having `Scope.run()` crash the frame if error leaks out of operation HOT 1
- 3.0 Public API review
- Effection examples HOT 2
- Unexpected return type for `all()` HOT 5
- Add ability to evaluate append an operation to the current frame
- Write a tutorial about "Build an Autocomplete with Structured Concurrency using Effection in React" HOT 19
- Reorganize Effection Documentation HOT 8
- How to delay abort/process shutdown? HOT 4
- RFC: Cultivate an Effection ecosystem with a contrib mono repository
- RFC: Embed API documentation into website
- imports not used when using multi-root workspaces for website development in VSCode HOT 2
- `.all()` creates a new Scope HOT 2
- add `allSettled()` operation congruent with `Promise.allSettled()`
- "finally" cleanup code not guaranteed to run in the correct order HOT 2
- add `withResolvers()` utility to be the analog of `Promise.withResolvers()`
- Docs typos HOT 5
- Please enable dark theme on web site
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from effection.