jsynchronous 0.9.3 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/jsynchronous-client.js +1 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,6 +52,8 @@ Jsynchronous can also handle server->server sync, or (experimentally) browser->s
|
|
|
52
52
|
|
|
53
53
|
# Setting up
|
|
54
54
|
|
|
55
|
+
Follow the [example code snippets](https://github.com/siriusastrebe/jsynchronous/tree/master/examples) for easy integration.
|
|
56
|
+
|
|
55
57
|
Jsynchronous does not lock you into a transportation medium you use whether it be [socket.io](https://socket.io/) [ws](https://www.npmjs.com/package/ws) [Primus](https://www.npmjs.com/package/primus), [EventSource](https://developer.mozilla.org/en-US/docs/Web/API/EventSource), or [webRTC](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API). Any protocol with eventual in-order delivery works. We will be using [ws](https://www.npmjs.com/package/ws) in this example.
|
|
56
58
|
|
|
57
59
|
The server side setup consists of 3 required steps:
|
package/jsynchronous-client.js
CHANGED
|
@@ -62,7 +62,7 @@ function jsynchronousSetup() {
|
|
|
62
62
|
if (jsynchronous.send) {
|
|
63
63
|
var uniqueId = 'initial' + name;
|
|
64
64
|
communicateWithBackoff(uniqueId, ['initial', name], function () {
|
|
65
|
-
console.log('Unknown jsynchronous variable, requesting initial' + name);
|
|
65
|
+
console.log('Unknown jsynchronous variable, requesting initial' + name);
|
|
66
66
|
return jsyncs[name] === undefined;
|
|
67
67
|
}, 2000);
|
|
68
68
|
} else {
|
|
@@ -666,11 +666,6 @@ console.log('Unknown jsynchronous variable, requesting initial' + name);
|
|
|
666
666
|
|
|
667
667
|
function addSynchronizedVariableMethods(jsync, targetVariable, reservedWords) {
|
|
668
668
|
// targetVariable will be details.variable if it's synced. Otherwise it should be a stand-in variable
|
|
669
|
-
for (var key in clientReservedWords) {
|
|
670
|
-
if (typeof targetVariable[key] === 'function') {
|
|
671
|
-
delete targetVariable[key];
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
669
|
if (reservedWords === undefined) reservedWords = {}
|
|
675
670
|
for (var key in clientReservedWords) {
|
|
676
671
|
if (!reservedWords[key]) {
|