Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "comlinkjs", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -14,3 +14,3 @@ # Comlink | ||
functions, etc) to the endpoint of an communications channel. Anything that | ||
works with `postMessage` can be used as a communication channel. on the other | ||
works with `postMessage` can be used as a communication channel. On the other | ||
end of that channel you can use Comlink to synthesize an ES6 proxy. Every action | ||
@@ -23,3 +23,3 @@ performed on that proxy object will be serialized using a simple (and naïve) RPC | ||
```html | ||
// index.html | ||
<-- index.html --> | ||
<!doctype html> | ||
@@ -71,3 +71,4 @@ <script src="../../dist/comlink.global.js"></script> | ||
* **“es6”**: This package uses the native ES6 module format. Due to some | ||
hackery, the module exports an `Comlin` object. Import it as follows: | ||
necessary hackery, the module exports a `Comlink` object. | ||
Import it as follows: | ||
@@ -86,3 +87,3 @@ ```js | ||
These packages can be mixed and matched. A worker using `global` can work | ||
with a Window using `es6`. For the sake of network conversation, I do recommend | ||
with a window using `es6`. For the sake of network conservation, I do recommend | ||
sticking to one format, though. | ||
@@ -97,3 +98,3 @@ | ||
`proxy` creates an ES6 proxy and sends all operations through the channel behind | ||
`endpoint`. On the other end of the channel should be passed to `expose`. | ||
`endpoint`. The other end of the channel should be passed to `expose`. | ||
@@ -104,9 +105,10 @@ ### `expose: (rootObj, endpoint)` | ||
`rootObj`. The return value will be structurally cloned and sent back. Values | ||
that implement the [`Transferable`][transferable] interface, will be transferred. | ||
that implement the [`Transferable`][transferable] interface will be transferred. | ||
### `proxyValue(value)` | ||
If structurally cloning a value is undesired, wrapping the value in `proxyValue` | ||
will cause `expose` to instead send back a [`MessagePort`][MessagePort] that | ||
will be hooked up to a new proxy on the other end. | ||
If structurally cloning a return value is undesired, wrapping the value in a | ||
`proxyValue` call will cause `expose` to send back a | ||
[`MessagePort`][MessagePort] instead of the actual value. The `MessagePort` will | ||
be hooked up to a new proxy on the other end. | ||
@@ -113,0 +115,0 @@ |
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
57806
116