effection
Advanced tools
Comparing version 0.3.0-d868f08 to 0.3.0-e972f78
{ | ||
"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*() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40236
13
1177
168