coterminous-js-messageport
Advanced tools
Comparing version 0.1.7 to 0.2.0
{ | ||
"name": "coterminous-js-messageport", | ||
"version": "0.1.7", | ||
"version": "0.2.0", | ||
"description": "A transport for use with Message Ports such as WebWorkers", | ||
@@ -5,0 +5,0 @@ "main": "npm/messageport.js", |
@@ -5,3 +5,3 @@ # coterminous-js-messageport | ||
### Useage in the Worker | ||
<syntaxhighlight lang="js"> | ||
``` | ||
Coterminous.root({ | ||
@@ -15,6 +15,6 @@ //... your exposed api functions here | ||
} | ||
</syntaxhighlight> | ||
``` | ||
### Useage in the Browser | ||
<syntaxhighlight lang="js"> | ||
``` | ||
var worker = new SharedWorker('worker.js'); | ||
@@ -29,8 +29,9 @@ Coterminous.connect(new MessagePortTransport(worker.port)).then(function(remoteInterface) | ||
}); | ||
</syntaxhighlight> | ||
``` | ||
### Changing Direction | ||
Connect - connects and gets the root object | ||
ConnectTransport - just connects | ||
You can swap these around to suit your needs, worker going to call the webpage? use connect. api calls in both directions? sure! Use connect in both places. | ||
You can swap these around to suit your needs, worker going to call the webpage? use connect. api calls in both directions? sure! Use connect in both places. |
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
35
9038