client-ketchup
Advanced tools
Comparing version 0.3.0 to 1.0.0
{ | ||
"name": "client-ketchup", | ||
"version": "0.3.0", | ||
"version": "1.0.0", | ||
"description": "A simple interface for keeping remote clients up to date with their authoritative state", | ||
@@ -30,8 +30,6 @@ "main": "src/client-state-update.js", | ||
"devDependencies": { | ||
"minimal-object-diff": "^0.1.0", | ||
"standard": "^7.1.2", | ||
"tape": "^4.6.0" | ||
}, | ||
"dependencies": { | ||
"minimal-object-diff": "^0.1.0" | ||
} | ||
} |
@@ -36,3 +36,5 @@ client-ketchup [![npm version](https://badge.fury.io/js/client-ketchup.svg)](http://badge.fury.io/js/client-ketchup) [![Build Status](https://travis-ci.org/chinedufn/client-ketchup.svg?branch=master)](https://travis-ci.org/chinedufn/client-ketchup) | ||
// Create a new client state tracker. You'll typically use one of these and add/remove different clients to it | ||
var CST = CreateClientStateTracker() | ||
var CST = CreateClientStateTracker({ | ||
differ: require('minimal-object-diff').diff | ||
}) | ||
@@ -39,0 +41,0 @@ // Add a new client |
@@ -1,6 +0,4 @@ | ||
var objectDiff = require('minimal-object-diff') | ||
module.exports = CreateClientStateUpdater | ||
function CreateClientStateUpdater () { | ||
function CreateClientStateUpdater (opts) { | ||
var clientStateMap = {} | ||
@@ -28,3 +26,3 @@ | ||
function UpdateKey (key, newState) { | ||
var patches = objectDiff.diff(clientStateMap[key], newState) | ||
var patches = opts.differ(clientStateMap[key], newState) | ||
clientStateMap[key] = newState | ||
@@ -31,0 +29,0 @@ |
var test = require('tape') | ||
var objectDiffer = require('minimal-object-diff').diff | ||
var CreateClientStateUpdater = require('../') | ||
@@ -6,3 +7,5 @@ | ||
t.plan(1) | ||
var CSU = CreateClientStateUpdater() | ||
var CSU = CreateClientStateUpdater({ | ||
differ: objectDiffer | ||
}) | ||
CSU.add('key', { value: true, value2: true }) | ||
@@ -9,0 +12,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5820
0
36
0
120
3
- Removedminimal-object-diff@^0.1.0
- Removedchangeset@0.1.0(transitive)
- Removeddeep-extend@0.4.2(transitive)
- Removeddot-prop@3.0.0(transitive)
- Removedis-obj@1.0.1(transitive)
- Removedminimal-object-diff@0.1.0(transitive)
- Removedudc@1.0.1(transitive)
- Removedunderscore@1.4.4(transitive)