Merge branch 'master' into test-with-deferred

This commit is contained in:
Mariusz Nowak
2017-02-17 12:19:21 +01:00
3 changed files with 16 additions and 9 deletions

View File

@@ -1,3 +1,9 @@
v0.4.2 -- 2017.02.17
* Guard proper promise resolution in promise mode
* Improve documentation
* Improve npm scripts configuration
* Improve CI configuration
v0.4.1 -- 2016.07.13
* Fix promise mode to not use `then` and `finally` pair. Thanks @Kovensky
* Add 'done' mode to 'promise' mode (so now callbacks can be registered through `done` but no

View File

@@ -26,10 +26,10 @@ require('../lib/registered-extensions').promise = function (mode, conf) {
var onSuccess = function (result) {
var count = waiting[id];
if (isFailed) {
throw new Error("Memoizee error: Promise handling resolved with both failure and success," +
" This can be result of unordered done & finally resolution.\n" +
"Instead of `promise: true` consider configuring memoization with `promise: 'done'` or " +
"`promise: `then`");
throw new Error("Memoizee error: Promise resolved with both failure and success," +
" this can be result of unordered done & finally resolution.\n" +
"Instead of `promise: true` consider configuring memoization via `promise: 'then'` or " +
"`promise: 'done'");
}
if (!count) return; // deleted from cache before resolved
delete waiting[id];

View File

@@ -1,6 +1,6 @@
{
"name": "memoizee",
"version": "0.4.1",
"version": "0.4.2",
"description": "Memoize/cache function results",
"author": "Mariusz Nowak <medikoo@medikoo.com> (http://www.medikoo.com/)",
"keywords": [
@@ -37,14 +37,15 @@
"devDependencies": {
"deferred": "^0.7.5",
"plain-promise": "^0.1.1",
"tad": "^0.2.4",
"tad": "^0.2.7",
"xlint": "^0.2.2",
"xlint-jslint-medikoo": "^0.1.4"
},
"scripts": {
"lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
"lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
"test": "node node_modules/tad/bin/tad"
"lint": "npm run lint-medikoo -- --no-cache --no-stream",
"lint-console": "npm run lint-medikoo -- --watch",
"lint-medikoo": "xlint --linter=node_modules/xlint-jslint-medikoo/index.js",
"test": "tad"
},
"license": "MIT"
}