Socket
Socket
Sign inDemoInstall

effection

Package Overview
Dependencies
Maintainers
1
Versions
299
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

effection - npm Package Compare versions

Comparing version 0.3.0-d868f08 to 0.3.0-e972f78

2

package.json
{
"name": "effection",
"description": "Effortlessly composable structured concurrency primitive for JavaScript",
"version": "0.3.0-d868f08",
"version": "0.3.0-e972f78",
"license": "MIT",

@@ -6,0 +6,0 @@ "files": [

@@ -117,8 +117,7 @@ [![npm](https://img.shields.io/npm/v/effection.svg)](https://www.npmjs.com/package/effection)

In order to abstract a process so that it can take arguments, you can
use the `call` function:
You can pass arguments to an operation by invoking it.
``` javascript
import { fork, timeout, call } from 'effection';
import { fork, timeout } from 'effection';

@@ -129,19 +128,5 @@ function* waitForSeconds(durationSeconds) {

fork(function*() {
yield call(waitforseconds, 10);
});
fork(waitforseconds(10));
```
More likely though, you would want to define a higher-order function
that took your argument and returned a generator:
``` javascript
function waitForSeconds(durationSeconds) {
return function*() {
yield timeout(durationSeconds * 1000);
}
}
```
### Asynchronous Execution

@@ -157,3 +142,3 @@

``` javascript
import { fork, fork } from 'effection';
import { fork } from 'effection';

@@ -160,0 +145,0 @@ fork(function*() {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc