@filerobot/store-default
Advanced tools
Comparing version 1.8.0 to 2.0.0-beta.0
@@ -0,9 +1,8 @@ | ||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
// TODO: find a way to show version of the current plugin | ||
@@ -19,3 +18,2 @@ // why solution below isn't good? | ||
// import packageInfo from '../package.json' | ||
/** | ||
@@ -26,9 +24,8 @@ * Default store that keeps state in a simple object. | ||
// static VERSION = packageInfo.version | ||
function DefaultStore() { | ||
_classCallCheck(this, DefaultStore); | ||
this.state = {}; | ||
this.callbacks = []; | ||
} | ||
_createClass(DefaultStore, [{ | ||
@@ -43,7 +40,4 @@ key: "getState", | ||
var prevState = _extends({}, this.state); | ||
var nextState = _extends({}, this.state, patch); | ||
this.state = nextState; | ||
this._publish(prevState, nextState, patch); | ||
@@ -55,3 +49,2 @@ } | ||
var _this = this; | ||
this.callbacks.push(listener); | ||
@@ -69,3 +62,2 @@ return function () { | ||
} | ||
this.callbacks.forEach(function (listener) { | ||
@@ -76,8 +68,6 @@ listener.apply(void 0, args); | ||
}]); | ||
return DefaultStore; | ||
}(); | ||
export default function defaultStore() { | ||
return new DefaultStore(); | ||
} |
{ | ||
"name": "@filerobot/store-default", | ||
"description": "The default simple object-based store for Filerobot Media Asset Widget.", | ||
"version": "1.8.0", | ||
"version": "2.0.0-beta.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5804
79
2