Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-async-computed

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-async-computed - npm Package Compare versions

Comparing version 3.2.1 to 3.3.0-rc1

dist/lazy.js

42

dist/index.js
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(['module', 'exports'], factory);
define(['module', 'exports', './lazy'], factory);
} else if (typeof exports !== "undefined") {
factory(module, exports);
factory(module, exports, require('./lazy'));
} else {

@@ -10,6 +10,6 @@ var mod = {

};
factory(mod, mod.exports);
factory(mod, mod.exports, global.lazy);
global.AsyncComputed = mod.exports;
}
})(this, function (module, exports) {
})(this, function (module, exports, _lazy) {
'use strict';

@@ -20,2 +20,4 @@

});
var prefix = '_async_computed$';

@@ -36,3 +38,3 @@

for (var key in this.$options.asyncComputed || {}) {
this.$options.computed[prefix + key] = getterFor(this.$options.asyncComputed[key]);
this.$options.computed[prefix + key] = getterFn(key, this.$options.asyncComputed[key]);
}

@@ -43,3 +45,9 @@

for (var _key in this.$options.asyncComputed || {}) {
data[_key] = null;
var item = this.$options.asyncComputed[_key];
if ((0, _lazy.isComputedLazy)(item)) {
(0, _lazy.initLazy)(data, _key);
this.$options.computed[_key] = (0, _lazy.makeLazyComputed)(_key);
} else {
data[_key] = null;
}
}

@@ -53,3 +61,9 @@ return data;

for (var key in this.$options.asyncComputed || {}) {
this[key] = defaultFor.call(this, this.$options.asyncComputed[key], pluginOptions);
var item = this.$options.asyncComputed[key],
value = generateDefault.call(this, item, pluginOptions);
if ((0, _lazy.isComputedLazy)(item)) {
(0, _lazy.silentSetLazy)(this, key, value);
} else {
this[key] = value;
}
}

@@ -93,3 +107,3 @@

function getterFor(fn) {
function getterFn(key, fn) {
if (typeof fn === 'function') return fn;

@@ -105,6 +119,16 @@

}
if ((0, _lazy.isComputedLazy)(fn)) {
var nonLazy = getter;
getter = function lazyGetter() {
if ((0, _lazy.isLazyActive)(this, key)) {
return nonLazy.call(this);
} else {
return (0, _lazy.silentGetLazy)(this, key);
}
};
}
return getter;
}
function defaultFor(fn, pluginOptions) {
function generateDefault(fn, pluginOptions) {
var defaultValue = null;

@@ -111,0 +135,0 @@

{
"name": "vue-async-computed",
"version": "3.2.1",
"version": "3.3.0-rc1",
"description": "Async computed properties for Vue",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc