thunky
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "thunky", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "delay the evaluation of a paramless async function and cache the result", | ||
"main": "index.js", | ||
"devDependencies": { | ||
"standard": "^7.1.2", | ||
"tape": "^4.6.0" | ||
"standard": "^12.0.1", | ||
"tape": "^4.9.1" | ||
}, | ||
@@ -10,0 +10,0 @@ "repository": { |
16
test.js
@@ -70,5 +70,5 @@ var tape = require('tape') | ||
var ran = 0 | ||
var run = thunky(function (cb) { | ||
var run = thunky(function (fn) { | ||
ran++ | ||
cb({hello: 'world'}) | ||
fn({ hello: 'world' }) | ||
}) | ||
@@ -78,9 +78,9 @@ | ||
t.same(ran, 1, 'ran once') | ||
t.same(val, {hello: 'world'}) | ||
t.same(val, { hello: 'world' }) | ||
run(function (val) { | ||
t.same(ran, 1, 'ran once') | ||
t.same(val, {hello: 'world'}) | ||
t.same(val, { hello: 'world' }) | ||
run(function (val) { | ||
t.same(ran, 1, 'ran once') | ||
t.same(val, {hello: 'world'}) | ||
t.same(val, { hello: 'world' }) | ||
}) | ||
@@ -95,5 +95,5 @@ }) | ||
var ran = 0 | ||
var run = thunky(function (cb) { | ||
var run = thunky(function (fn) { | ||
ran++ | ||
cb({hello: 'world'}) | ||
fn({ hello: 'world' }) | ||
}) | ||
@@ -104,3 +104,3 @@ | ||
t.same(ran, 1, 'ran once') | ||
t.same(val, {hello: 'world'}) | ||
t.same(val, { hello: 'world' }) | ||
}) | ||
@@ -107,0 +107,0 @@ }) |
7165