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

ladda-cache

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ladda-cache - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

dist/.tern-port

28

dist/bundle.js

@@ -496,2 +496,13 @@ module.exports =

} else {
if (type.indexOf('(*)') !== -1) {
var allMatcher = getAllMatcher(type.substring(0, type.length - 3));
var candidates = Object.keys(datastore.entityCache || {});
var toInvalidate = candidates.filter(function (x) {
return allMatcher.test(x);
});
toInvalidate.forEach(function (key) {
delete datastore.entityCache[key];
});
datastore.queryCache[type.substring(0, type.length - 3)] = {};
}
datastore.queryCache[type] = {};

@@ -502,2 +513,6 @@ }

function getAllMatcher(type) {
return new RegExp('^' + type + '.*$');
}
function invalidateQueryCacheByFunction(datastore, type, method) {

@@ -677,3 +692,3 @@ var matcher = getMatcher(type, method);

function getFromCache(apiFn, datastore, type, query) {
if (shouldUseQueryCache(apiFn.plural, apiFn.byId)) {
if (apiFn.plural) {
return getFromQueryCache(datastore, type, query, apiFn.name);

@@ -685,6 +700,2 @@ } else {

function shouldUseQueryCache(plural, byId) {
return plural === true || byId === false;
}
function getFromQueryCache(datastore, type, query, apiFnName) {

@@ -700,6 +711,5 @@ return (0, _datastore.getCollection)(datastore, createQueryForCollection(type, query, apiFnName));

return function (data) {
if (shouldUseQueryCache(apiFn.plural, apiFn.byId)) {
[apiFn.name].concat(apiFn.cacheAliases || []).map(function (fnName) {
(0, _datastore.addCollection)(datastore, createQueryForCollection(abstractEntity.name, query, fnName), data);
});
if (apiFn.plural) {
var collectionQuery = createQueryForCollection(abstractEntity.name, query, apiFn.name);
(0, _datastore.addCollection)(datastore, collectionQuery, data);
} else {

@@ -706,0 +716,0 @@ (0, _datastore.addItem)(datastore, (0, _query.createQuery)(abstractEntity.name, query), data);

{
"name": "ladda-cache",
"version": "0.0.10",
"version": "0.0.11",
"description": "Data fetching layaer with support for caching",

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

Sorry, the diff of this file is not supported yet

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