Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"name": "test",
"description": "Test app for persists package.",
"author": "Dave Winer <dave@scripting.com>",
"license": "MIT",
"version": "0.4.0",
"dependencies" : {
"persists": "*"
}
}
const utils = require ("daveutils");
const persists = require ("persists");
var initialstats = {
ct: 0,
slogan: "",
randomNumber: 0
};
var stats;
function everySecond () {
stats.ct++;
stats.slogan = utils.getRandomSnarkySlogan ();
stats.randomNumber = utils.random (0, 10000);
}
persists ("stats", initialstats, function (theProxy) {
stats = theProxy;
setInterval (everySecond, 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.