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

mojito-cache

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mojito-cache - npm Package Compare versions

Comparing version 0.0.3 to 0.0.5

2

package.json
{
"name": "mojito-cache",
"version": "0.0.3",
"version": "0.0.5",
"description": "A set of libraries for various caching strategies in mojito.",

@@ -5,0 +5,0 @@ "main": " ",

@@ -6,3 +6,3 @@ /*

*/
/*jslint nomen: true, indent: 4*/
/*jslint nomen: true, indent: 4, plusplus: true*/
/*global YUI, YUITest */

@@ -17,10 +17,14 @@

var staticAppConfig;
var staticAppConfig,
refreshedAddons;
this.dispatch = function (command, adapter) {
var refreshedAddons,
cache,
var cache,
cachedResource,
newCommand,
i,
addonName,
addonInstance,
AddonConstuct,
freshInstance = command.instance;

@@ -32,3 +36,2 @@

if (!adapter.req.globals['request-cache']) {
adapter.req.globals['request-cache'] = {

@@ -48,3 +51,6 @@ byBase: {},

staticAppConfig = staticAppConfig || this.store.getStaticAppConfig();
if (!refreshedAddons) {
staticAppConfig = this.store.getStaticAppConfig();
refreshedAddons = staticAppConfig['request-cache'] && staticAppConfig['request-cache'].refreshAddons;
}

@@ -55,23 +61,20 @@ newCommand = cachedResource.actionContext.command;

newCommand.params = command.params;
// This is specific to mojito-pipeline
newCommand.task = command.task;
Y.mix(newCommand.instance.config, command.instance.config, true);
// Instantiate again the addons that need to be refreshed
refreshedAddons = staticAppConfig['request-cache'] && staticAppConfig['request-cache'].refreshAddons;
refreshedAddons.forEach(function (addonName) {
for (i = 0; i < refreshedAddons.length; i++) {
AddonConstuct = Y.mojito.addons.ac[refreshedAddons[i]];
var addonInstance,
AddonConstuct = Y.mojito.addons.ac[addonName];
if (AddonConstuct) {
addonInstance = new AddonConstuct(newCommand, adapter, cachedResource.actionContext);
if (addonInstance.namespace && cachedResource.actionContext[addonInstance.namespace]) {
cachedResource.actionContext[addonInstance.namespace] = addonInstance;
}
}
});
}

@@ -85,7 +88,5 @@ // The adapter and its callbacks need to be refreshed

if (Y.Lang.isFunction(cachedResource.controller[newCommand.action])) {
cachedResource.controller[newCommand.action](cachedResource.actionContext);
}
} else {
// Expands the command.instance and creates a new AC

@@ -121,6 +122,4 @@ // which in turn instanciates all the addons and calls the controller

if (instance.base) {
cache.byBase[instance.base] = newExpandedResource;
} else if (instance.type) {
cache.byType[instance.type] = newExpandedResource;

@@ -127,0 +126,0 @@ }

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