vue-async-computed
Advanced tools
Comparing version 3.3.0-rc1 to 3.3.0-rc2
@@ -151,2 +151,61 @@ (function (global, factory) { | ||
module.exports = exports['default']; | ||
}); | ||
}); | ||
(function (global, factory) { | ||
if (typeof define === "function" && define.amd) { | ||
define(['exports'], factory); | ||
} else if (typeof exports !== "undefined") { | ||
factory(exports); | ||
} else { | ||
var mod = { | ||
exports: {} | ||
}; | ||
factory(mod.exports); | ||
global.lazy = mod.exports; | ||
} | ||
})(this, function (exports) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.isComputedLazy = isComputedLazy; | ||
exports.isLazyActive = isLazyActive; | ||
exports.initLazy = initLazy; | ||
exports.makeLazyComputed = makeLazyComputed; | ||
exports.silentSetLazy = silentSetLazy; | ||
exports.silentGetLazy = silentGetLazy; | ||
function isComputedLazy(item) { | ||
return item.hasOwnProperty('lazy') && item.lazy; | ||
} | ||
function isLazyActive(vm, key) { | ||
return vm[lazyActivePrefix + key]; | ||
} | ||
var lazyActivePrefix = 'async_computed$lazy_active$', | ||
lazyDataPrefix = 'async_computed$lazy_data$'; | ||
function initLazy(data, key) { | ||
data[lazyActivePrefix + key] = false; | ||
data[lazyDataPrefix + key] = null; | ||
} | ||
function makeLazyComputed(key) { | ||
return { | ||
get: function get() { | ||
this[lazyActivePrefix + key] = true; | ||
return this[lazyDataPrefix + key]; | ||
}, | ||
set: function set(value) { | ||
this[lazyDataPrefix + key] = value; | ||
} | ||
}; | ||
} | ||
function silentSetLazy(vm, key, value) { | ||
vm[lazyDataPrefix + key] = value; | ||
} | ||
function silentGetLazy(vm, key) { | ||
return vm[lazyDataPrefix + key]; | ||
} | ||
}); |
{ | ||
"name": "vue-async-computed", | ||
"version": "3.3.0-rc1", | ||
"version": "3.3.0-rc2", | ||
"description": "Async computed properties for Vue", | ||
@@ -13,7 +13,7 @@ "main": "dist/index.js", | ||
"lint": "eslint src test", | ||
"check": "npm run lint -s && dependency-check package.json --entry src", | ||
"check": "npm run lint -s && dependency-check package.json --no-default-entries src/index.js", | ||
"watch": "watch 'npm run build' src test", | ||
"test": "babel-node test/index.js | tspec", | ||
"prebuild": "npm run check -s && npm run clean -s", | ||
"build": "babel --optional runtime src -d dist", | ||
"build": "mkdir -p dist && babel --optional runtime src --out-file dist/index.js", | ||
"postbuild": "npm run test -s", | ||
@@ -20,0 +20,0 @@ "coverage": "node_modules/.bin/babel-node node_modules/.bin/babel-istanbul cover test/index.js", |
20897
178
5