synposis
Synopsis is a tool computing the effective deltas between two updates in a sequence of updates.
The approach I'm taking is to take a granularity N, and then precompute skip deltas of size N, N2, N3, etc.
Simple Counting Example:
// Uber simple Synopsis example that just calculates a running// total of a sum of integers with granularity of 5var async = ;var _ = ;var s =start: 0granularity: 5{return prev + patch;}{return after - before;};async;
Configuration
Supports specifying a custom store implementation, defaults to memory store if none is provided.
By doing so, the state of the Synopsis instance can be retained across restarts and none of the delta merging will need to be recomputed.
example:
var s =store:// get the value of the key in the store, or undefined if it isn't{ ... }// associate the value to the key in the store, undefined value is effectively a delete operation{ ... }// optionally define the following if the store provider has a batch operation for them.// getAll: function(keys, callback) { ... batch get hash ... }// putAll: function(obj, callback) { ... like setAll, but undefined values are deleted ... };