-
Notifications
You must be signed in to change notification settings - Fork 24
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
V2 Proof of Concept #194
V2 Proof of Concept #194
Conversation
Default to suspending indefinitely
This enables typescript strict mode. This highlights two issues: 1) We have to use `Generator` instead of `Iterator`, since the `return` and `throw` functions are not mandatory for `Iterator`, and we're currently not doing anything sensible if they are absent. 2) The TReturn of a generator has to be `TOut | undefined`, because in the case of a halt, there is no sensible value to return from the generator.
Strict mode
Unfortunately using `Operation<unknown>` though more typesafe, rules out too many safe programs to be useful.
Very often we don't know and don't care about the return value of a task. Since we erase this type so often, let's just default it to `unknown` so we don't have to type it out all the time.
💥 No ChangesetLatest commit: eb6cc78 Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂 If these changes should be published to npm, you need to add a changeset. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Click here to learn what changesets are, and how to add one. Click here if you're a maintainer who wants to add a changeset to this PR |
The preview packages of this pull request have been published. @effection/channelInstall using the following command: $ npm install @effection/channel@v2-poc Or update your package.json file: {
"@effection/channel": "v2-poc"
} effectionInstall using the following command: $ npm install effection@v2-poc Or update your package.json file: {
"effection": "v2-poc"
} @effection/eventsInstall using the following command: $ npm install @effection/events@v2-poc Or update your package.json file: {
"@effection/events": "v2-poc"
} @effection/nodeInstall using the following command: $ npm install @effection/node@v2-poc Or update your package.json file: {
"@effection/node": "v2-poc"
} @effection/subscriptionInstall using the following command: $ npm install @effection/subscription@v2-poc Or update your package.json file: {
"@effection/subscription": "v2-poc"
} |
Made an attempt at integrating jnicklas/mini-effection into the main repo and porting the existing plugins. It's been surprisingly straightforward, and most of the plugins were pretty easy to port.
I mostly did this to convince myself that mini-effection really can be equivalent in expressive power to effection, and it does seem to be the case.