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

amo

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amo - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

4

dist/amo.js

@@ -443,3 +443,5 @@ (function (global, factory) {

var store = new regux.Store();
store.use( logger() );
if ( process.env.NODE_ENV === 'development' ) {
store.use( logger() );
}
this._store = store;

@@ -446,0 +448,0 @@ };

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.AMO=e()}(this,function(){"use strict";function t(t,e){return e={exports:{}},t(e,e.exports),e.exports}var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o=t(function(t,o){!function(e,n){"object"==typeof o&&"undefined"!=typeof t?t.exports=n():"function"==typeof define&&define.amd?define(n):e.regux=n()}(e,function(){function t(t,e){var o={};return Object.keys(t).forEach(function(n){o[e+"/"+n]=t[n]}),o}function e(t){return"undefined"!=typeof t.type}function o(t){return t&&t instanceof c}var n=function(){function t(t){return function(e){return t.call(e,e.data)}}function e(t){return function(e,o){return t.call(e,o,e.data),o}}return function(o){if(o){var n,r,i,s={};for(var c in o)n=o[c],i=typeof n,"expression"!==n.type?"string"!==i&&(r=s[c]={type:"expression"},"function"===i?r.get=t(n):(n.get&&(r.get=t(n.get)),n.set&&(r.set=e(n.set)))):s[c]=n;return s}}}(),r=function(t,e){Object.assign(t.computed||{},n(e))},i=function(){this.t=null,this.tasks=[]};i.prototype.add=function(t){this.tasks.push(t)},i.prototype.run=function(t){var e=this;this.t&&clearTimeout(this.t),this.t=setTimeout(function(){t(),e.tasks.forEach(function(t,o){"function"==typeof t&&(t(),e.tasks[o]=null)}),e.tasks.length=0},0)};var s=function(){return function(t){var e=window&&window.__REO_DEVTOOLS_HOOK__;e&&(t._devtools=e,e.emit("reo:init",t),e.on("reo:travel-to-state",function(e){t.replaceState(e)}),e.on("reo:silent-travel-to-state",function(e){t.replaceState(e,{silent:!0})}),t.subscribe(function(t,o){e.emit("reo:reducer",t,o)}),t.subscribeViewUpdate(function(){e.emit("reo:view-updated")}))}},c=function(t){var e=this;void 0===t&&(t={});var o=t.modules;void 0===o&&(o={});var n=t.actions;void 0===n&&(n={});var r=t.plugins;void 0===r&&(r=[]),Object.assign(this,{_state:{},_reducers:{},_modules:o,_getters:{},_actions:n,_plugins:r,_subscribers:[],_viewUpdateSubscribers:[],scheduler:new i}),Object.keys(o).forEach(function(t){return e.registerModule(t,o[t])}),s()(this),r.forEach(function(t){return e.use(t)})};c.prototype.use=function(t){t(this)},c.prototype.replaceState=function(t,e){void 0===e&&(e={});var o=e.silent;void 0===o&&(o=!1),this._state=t,o||this.syncView()},c.prototype.getState=function(){return this._state},c.prototype.getGetters=function(){return this._getters},c.prototype.nextTick=function(t){this.scheduler.add(t)},c.prototype.dispatch=function(t,o){var n,r=this;if("string"==typeof t)n={type:t,payload:o};else{if(!e(t))return console.error("invalid dispatch params",arguments);n=t}var i=this._actions[n.type];return"function"!=typeof i?console.error("action",n.type,"not found"):i({getState:this.getState.bind(this),state:this.getState(),get:function(t){var e=r.getGetters(),o=e[t];if("function"==typeof o)return o(r.getState())},commit:this.commit.bind(this),dispatch:this.dispatch.bind(this),nextTick:this.nextTick.bind(this)},n.payload)},c.prototype.commit=function(t,o){var n,r=this;if("string"==typeof t)n={type:t,payload:o};else{if(!e(t))return console.error("invalid commit params",arguments);n=t}var i=this._reducers[n.type];if("function"==typeof i){var s=this.getState(),c="undefined"==typeof i.key?s:s[i.key];i(c,n.payload),this._applySubscribers(n,s),this.scheduler.run(function(){return r.syncView()})}else console.error("reducer",n.type,"not found")},c.prototype.syncView=function(){this._host.$update(),this._viewUpdateSubscribers.forEach(function(t){return t()})},c.prototype.host=function(t){this._host=t},c.prototype.subscribe=function(t){"function"==typeof t&&this._subscribers.push(t)},c.prototype.subscribeViewUpdate=function(t){"function"==typeof t&&this._viewUpdateSubscribers.push(t)},c.prototype.registerModule=function(e,o){if(void 0===e&&(e=""),void 0===o&&(o={}),!e)return console.error("Please provide a name when register module");this._state[e]=o.state||{};var n=o.reducers||{};for(var r in n)n[r].key=e;n=t(n,e),Object.assign(this._reducers,n)},c.prototype.registerActions=function(t){void 0===t&&(t={}),Object.assign(this._actions,t)},c.prototype.registerGetters=function(t){void 0===t&&(t={}),Object.assign(this._getters,t)},c.prototype._applySubscribers=function(t,e){for(var o=this._subscribers,n=0,r=o.length;n<r;n++){var i=o[n];i(t,e)}};var u=function(t){var e;t.implement({events:{$config:function(){if(o(this.store)&&(e&&(console.warn("store already exists"),console.warn("old store:",e),console.warn("new store:",this.store),console.warn("new store will be used")),e=this.store,e.host(this),delete this.store),!e)return console.warn("store not found");this.$store=e,this.commit=e.commit.bind(e),this.dispatch=e.dispatch.bind(e),this.nextTick=e.nextTick.bind(e);var t=e.getGetters(),n=this,i=n.getters;void 0===i&&(i={}),Object.keys(i).forEach(function(o){var n=i[o];"string"==typeof n&&(n=t[n]),"function"==typeof n&&(i[o]=function(){return n(e.getState())})}),r(this,i)}}})};return u.Store=c,u})}),n=t(function(t,o){!function(e,n){"object"==typeof o&&"undefined"!=typeof t?t.exports=n():"function"==typeof define&&define.amd?define(n):e.logger=n()}(e,function(){function t(t){void 0===t&&(t={});var e=t.collapsed;void 0===e&&(e=!0);var n=t.transformer;void 0===n&&(n=function(t){return t});var r=t.mutationTransformer;return void 0===r&&(r=function(t){return t}),function(t){var i=JSON.parse(JSON.stringify(t.getState()));t.subscribe(function(t,s){var c=JSON.parse(JSON.stringify(s)),u=new Date,f=" @ "+o(u.getHours(),2)+":"+o(u.getMinutes(),2)+":"+o(u.getSeconds(),2)+"."+o(u.getMilliseconds(),3),a="commit "+t.type+f;e?console.groupCollapsed(a):console.group(a),console.log("%c prev state","color: #9E9E9E; font-weight: bold",n(i)),console.log("%c commit","color: #03A9F4; font-weight: bold",r(t)),console.log("%c next state","color: #4CAF50; font-weight: bold",n(c)),console.groupEnd(a),i=c})}}function e(t,e){return new Array(e+1).join(t)}function o(t,o){return e("0",o-t.toString().length)+t}return t})}),r=function(){var t=new o.Store;t.use(n()),this._store=t};r.prototype.getStore=function(){return this._store},r.prototype.use=function(t){t.use(o)},r.prototype.model=function(t){void 0===t&&(t={});var e=t.name;if(!e)return console.error("Please provide name for model",t);var o=this.getStore();o.registerModule(e,t)},r.prototype.getters=function t(t){var e=this.getStore();e.registerGetters(t)},r.prototype.actions=function t(t){void 0===t&&(t={});var e=this.getStore();e.registerActions(t)},r.prototype.start=function(t,e){return new t({store:this.getStore()}).$inject(document.querySelector(e))};var i=function(){return new r};return i});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.AMO=e()}(this,function(){"use strict";function t(t,e){return e={exports:{}},t(e,e.exports),e.exports}var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o=t(function(t,o){!function(e,n){"object"==typeof o&&"undefined"!=typeof t?t.exports=n():"function"==typeof define&&define.amd?define(n):e.regux=n()}(e,function(){function t(t,e){var o={};return Object.keys(t).forEach(function(n){o[e+"/"+n]=t[n]}),o}function e(t){return"undefined"!=typeof t.type}function o(t){return t&&t instanceof c}var n=function(){function t(t){return function(e){return t.call(e,e.data)}}function e(t){return function(e,o){return t.call(e,o,e.data),o}}return function(o){if(o){var n,r,i,s={};for(var c in o)n=o[c],i=typeof n,"expression"!==n.type?"string"!==i&&(r=s[c]={type:"expression"},"function"===i?r.get=t(n):(n.get&&(r.get=t(n.get)),n.set&&(r.set=e(n.set)))):s[c]=n;return s}}}(),r=function(t,e){Object.assign(t.computed||{},n(e))},i=function(){this.t=null,this.tasks=[]};i.prototype.add=function(t){this.tasks.push(t)},i.prototype.run=function(t){var e=this;this.t&&clearTimeout(this.t),this.t=setTimeout(function(){t(),e.tasks.forEach(function(t,o){"function"==typeof t&&(t(),e.tasks[o]=null)}),e.tasks.length=0},0)};var s=function(){return function(t){var e=window&&window.__REO_DEVTOOLS_HOOK__;e&&(t._devtools=e,e.emit("reo:init",t),e.on("reo:travel-to-state",function(e){t.replaceState(e)}),e.on("reo:silent-travel-to-state",function(e){t.replaceState(e,{silent:!0})}),t.subscribe(function(t,o){e.emit("reo:reducer",t,o)}),t.subscribeViewUpdate(function(){e.emit("reo:view-updated")}))}},c=function(t){var e=this;void 0===t&&(t={});var o=t.modules;void 0===o&&(o={});var n=t.actions;void 0===n&&(n={});var r=t.plugins;void 0===r&&(r=[]),Object.assign(this,{_state:{},_reducers:{},_modules:o,_getters:{},_actions:n,_plugins:r,_subscribers:[],_viewUpdateSubscribers:[],scheduler:new i}),Object.keys(o).forEach(function(t){return e.registerModule(t,o[t])}),s()(this),r.forEach(function(t){return e.use(t)})};c.prototype.use=function(t){t(this)},c.prototype.replaceState=function(t,e){void 0===e&&(e={});var o=e.silent;void 0===o&&(o=!1),this._state=t,o||this.syncView()},c.prototype.getState=function(){return this._state},c.prototype.getGetters=function(){return this._getters},c.prototype.nextTick=function(t){this.scheduler.add(t)},c.prototype.dispatch=function(t,o){var n,r=this;if("string"==typeof t)n={type:t,payload:o};else{if(!e(t))return console.error("invalid dispatch params",arguments);n=t}var i=this._actions[n.type];return"function"!=typeof i?console.error("action",n.type,"not found"):i({getState:this.getState.bind(this),state:this.getState(),get:function(t){var e=r.getGetters(),o=e[t];if("function"==typeof o)return o(r.getState())},commit:this.commit.bind(this),dispatch:this.dispatch.bind(this),nextTick:this.nextTick.bind(this)},n.payload)},c.prototype.commit=function(t,o){var n,r=this;if("string"==typeof t)n={type:t,payload:o};else{if(!e(t))return console.error("invalid commit params",arguments);n=t}var i=this._reducers[n.type];if("function"==typeof i){var s=this.getState(),c="undefined"==typeof i.key?s:s[i.key];i(c,n.payload),this._applySubscribers(n,s),this.scheduler.run(function(){return r.syncView()})}else console.error("reducer",n.type,"not found")},c.prototype.syncView=function(){this._host.$update(),this._viewUpdateSubscribers.forEach(function(t){return t()})},c.prototype.host=function(t){this._host=t},c.prototype.subscribe=function(t){"function"==typeof t&&this._subscribers.push(t)},c.prototype.subscribeViewUpdate=function(t){"function"==typeof t&&this._viewUpdateSubscribers.push(t)},c.prototype.registerModule=function(e,o){if(void 0===e&&(e=""),void 0===o&&(o={}),!e)return console.error("Please provide a name when register module");this._state[e]=o.state||{};var n=o.reducers||{};for(var r in n)n[r].key=e;n=t(n,e),Object.assign(this._reducers,n)},c.prototype.registerActions=function(t){void 0===t&&(t={}),Object.assign(this._actions,t)},c.prototype.registerGetters=function(t){void 0===t&&(t={}),Object.assign(this._getters,t)},c.prototype._applySubscribers=function(t,e){for(var o=this._subscribers,n=0,r=o.length;n<r;n++){var i=o[n];i(t,e)}};var u=function(t){var e;t.implement({events:{$config:function(){if(o(this.store)&&(e&&(console.warn("store already exists"),console.warn("old store:",e),console.warn("new store:",this.store),console.warn("new store will be used")),e=this.store,e.host(this),delete this.store),!e)return console.warn("store not found");this.$store=e,this.commit=e.commit.bind(e),this.dispatch=e.dispatch.bind(e),this.nextTick=e.nextTick.bind(e);var t=e.getGetters(),n=this,i=n.getters;void 0===i&&(i={}),Object.keys(i).forEach(function(o){var n=i[o];"string"==typeof n&&(n=t[n]),"function"==typeof n&&(i[o]=function(){return n(e.getState())})}),r(this,i)}}})};return u.Store=c,u})}),n=t(function(t,o){!function(e,n){"object"==typeof o&&"undefined"!=typeof t?t.exports=n():"function"==typeof define&&define.amd?define(n):e.logger=n()}(e,function(){function t(t){void 0===t&&(t={});var e=t.collapsed;void 0===e&&(e=!0);var n=t.transformer;void 0===n&&(n=function(t){return t});var r=t.mutationTransformer;return void 0===r&&(r=function(t){return t}),function(t){var i=JSON.parse(JSON.stringify(t.getState()));t.subscribe(function(t,s){var c=JSON.parse(JSON.stringify(s)),u=new Date,f=" @ "+o(u.getHours(),2)+":"+o(u.getMinutes(),2)+":"+o(u.getSeconds(),2)+"."+o(u.getMilliseconds(),3),a="commit "+t.type+f;e?console.groupCollapsed(a):console.group(a),console.log("%c prev state","color: #9E9E9E; font-weight: bold",n(i)),console.log("%c commit","color: #03A9F4; font-weight: bold",r(t)),console.log("%c next state","color: #4CAF50; font-weight: bold",n(c)),console.groupEnd(a),i=c})}}function e(t,e){return new Array(e+1).join(t)}function o(t,o){return e("0",o-t.toString().length)+t}return t})}),r=function(){var t=new o.Store;"development"===process.env.NODE_ENV&&t.use(n()),this._store=t};r.prototype.getStore=function(){return this._store},r.prototype.use=function(t){t.use(o)},r.prototype.model=function(t){void 0===t&&(t={});var e=t.name;if(!e)return console.error("Please provide name for model",t);var o=this.getStore();o.registerModule(e,t)},r.prototype.getters=function t(t){var e=this.getStore();e.registerGetters(t)},r.prototype.actions=function t(t){void 0===t&&(t={});var e=this.getStore();e.registerActions(t)},r.prototype.start=function(t,e){return new t({store:this.getStore()}).$inject(document.querySelector(e))};var i=function(){return new r};return i});
//# sourceMappingURL=amo.min.js.map
{
"name": "amo",
"version": "0.0.5",
"version": "0.0.6",
"main": "dist/amo.js",

@@ -5,0 +5,0 @@ "scripts": {

@@ -7,3 +7,5 @@ import regux from 'regux';

const store = new regux.Store();
store.use( logger() );
if ( process.env.NODE_ENV === 'development' ) {
store.use( logger() );
}
this._store = store;

@@ -10,0 +12,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