diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/src/query.js b/src/query.js index d00441b..d80716e 100644 --- a/src/query.js +++ b/src/query.js @@ -19,9 +19,9 @@ export function query(from = 0, delta = 1) { return { subscribe: counter.subscribe, - update: (delta) => { + set delta(value) { clearInterval(interval); - interval = timer(delta); - }, + interval = timer(value); + } } } diff --git a/src/stores.js b/src/stores.js index 0a08cc9..a16dcc9 100644 --- a/src/stores.js +++ b/src/stores.js @@ -17,7 +17,7 @@ export const stream = vcDerived([from, delta], ([$from, $delta, fired], set) => unsubscribe = qry.subscribe(set); } else { console.log('callback: query update counter stream delta', $delta, 'fired:', fired); - qry.update($delta) + qry.delta = $delta; } // cleanup / stop return (fired) => { // fired: null or store_id (pending)