Comparing version 0.0.3 to 0.0.4
@@ -179,3 +179,3 @@ "use strict"; | ||
console.warn("Api disconnected from \"" + this.address + "\""); | ||
setTimeout($(this).dispatch.bind(this), $(this).reconnectDelay * 100); | ||
setTimeout($(this).dispatch, $(this).reconnectDelay * 100); | ||
$(this).reconnectDelay += 1; | ||
@@ -215,2 +215,2 @@ this.trigger(_Events.API.DISCONNECT, e); | ||
exports["default"] = new Api(); | ||
module.exports = exports["default"]; | ||
module.exports = exports["default"]; |
@@ -23,2 +23,2 @@ "use strict"; | ||
exports.Resource = _Resource2["default"]; | ||
exports.Store = _Store2["default"]; | ||
exports.Store = _Store2["default"]; |
@@ -39,2 +39,2 @@ "use strict"; | ||
}; | ||
exports.RESOURCE = RESOURCE; | ||
exports.RESOURCE = RESOURCE; |
@@ -165,10 +165,8 @@ "use strict"; | ||
var add = _patch[1]; | ||
var jsonDataArr = $(this).jsonData.split(""); | ||
for (var index in del) { | ||
jsonDataArr.splice(index, del[index]); | ||
$(this).jsonData = $(this).jsonData.slice(0, index) + $(this).jsonData.slice(del[index]); | ||
}for (var index in add) { | ||
Array.prototype.splice.apply(jsonDataArr, [index, 0].concat(add[index].split(""))); | ||
}var jsonData = jsonDataArr.join(""); | ||
$(this).jsonData = jsonData; | ||
$(this).replaceData(JSON.parse(jsonData)); | ||
$(this).jsonData = $(this).jsonData.slice(0, index) + add[index] + $(this).jsonData.slice(index); | ||
}$(this).replaceData(JSON.parse($(this).jsonData)); | ||
}, | ||
@@ -197,2 +195,2 @@ | ||
exports["default"] = Resource; | ||
module.exports = exports["default"]; | ||
module.exports = exports["default"]; |
@@ -32,2 +32,2 @@ "use strict"; | ||
exports["default"] = new Store(); | ||
module.exports = exports["default"]; | ||
module.exports = exports["default"]; |
{ | ||
"name": "apiway", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Client side for Apiway framework", | ||
@@ -5,0 +5,0 @@ "main": "./dst/Apiway.js", |
@@ -112,3 +112,3 @@ import Promise from "native-promise-only"; | ||
console.warn( `Api disconnected from "${ this.address }"` ); | ||
setTimeout( $( this ).dispatch.bind( this ), $( this ).reconnectDelay * 100 ); | ||
setTimeout( $( this ).dispatch, $( this ).reconnectDelay * 100 ); | ||
$( this ).reconnectDelay += 1; | ||
@@ -115,0 +115,0 @@ this.trigger( API.DISCONNECT, e ); |
@@ -110,9 +110,6 @@ import Private from "js.private"; | ||
applyDataPatch: function( patch ){ | ||
let [ del, add ] = patch, | ||
jsonDataArr = $( this ).jsonData.split( `` ); | ||
for( let index in del ) jsonDataArr.splice( index, del[ index ] ); | ||
for( let index in add ) Array.prototype.splice.apply( jsonDataArr, [ index, 0 ].concat( add[ index ].split( `` ) ) ); | ||
let jsonData = jsonDataArr.join( `` ); | ||
$( this ).jsonData = jsonData; | ||
$( this ).replaceData( JSON.parse( jsonData ) ); | ||
let [ del, add ] = patch; | ||
for( let index in del ) $( this ).jsonData = $( this ).jsonData.slice( 0, index ) + $( this ).jsonData.slice( del[ index ] ); | ||
for( let index in add ) $( this ).jsonData = $( this ).jsonData.slice( 0, index ) + add[ index ] + $( this ).jsonData.slice( index ); | ||
$( this ).replaceData( JSON.parse( $( this ).jsonData ) ); | ||
}, | ||
@@ -119,0 +116,0 @@ |
28691
674