Comparing version 5.0.0-1536860951275 to 5.0.0-1536863128047
@@ -63,3 +63,3 @@ var _createClass = 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
_this.version = "5.0.0-1536860951275"; | ||
_this.version = "5.0.0-1536863128047"; | ||
_this.debuggerWatchMap = {}; | ||
@@ -66,0 +66,0 @@ _this.debuggerComputedMap = {}; |
import { isObject } from '../utils'; | ||
export default function (target, value) { | ||
function set(_ref) { | ||
var store = _ref.store, | ||
props = _ref.props, | ||
resolve = _ref.resolve; | ||
export default function (target, value, transformFn) { | ||
function set(context) { | ||
var store = context.store, | ||
props = context.props, | ||
resolve = context.resolve; | ||
if (!resolve.isTag(target, 'state', 'props', 'moduleState')) { | ||
@@ -21,2 +22,6 @@ throw new Error('Cerebral factory.set: You have to use the STATE, PROPS or MODULESTATE tag as first argument'); | ||
if (transformFn) { | ||
resolvedValue = transformFn(resolvedValue, context); | ||
} | ||
if (target.type === 'state' || target.type === 'moduleState') { | ||
@@ -23,0 +28,0 @@ store.set(target, resolvedValue); |
@@ -81,3 +81,3 @@ 'use strict'; | ||
_this.version = "5.0.0-1536860951275"; | ||
_this.version = "5.0.0-1536863128047"; | ||
_this.debuggerWatchMap = {}; | ||
@@ -84,0 +84,0 @@ _this.debuggerComputedMap = {}; |
@@ -7,8 +7,9 @@ 'use strict'; | ||
exports.default = function (target, value) { | ||
function set(_ref) { | ||
var store = _ref.store, | ||
props = _ref.props, | ||
resolve = _ref.resolve; | ||
exports.default = function (target, value, transformFn) { | ||
function set(context) { | ||
var store = context.store, | ||
props = context.props, | ||
resolve = context.resolve; | ||
if (!resolve.isTag(target, 'state', 'props', 'moduleState')) { | ||
@@ -26,2 +27,6 @@ throw new Error('Cerebral factory.set: You have to use the STATE, PROPS or MODULESTATE tag as first argument'); | ||
if (transformFn) { | ||
resolvedValue = transformFn(resolvedValue, context); | ||
} | ||
if (target.type === 'state' || target.type === 'moduleState') { | ||
@@ -28,0 +33,0 @@ store.set(target, resolvedValue); |
{ | ||
"name": "cerebral", | ||
"version": "5.0.0-1536860951275", | ||
"version": "5.0.0-1536863128047", | ||
"description": "A state controller with its own debugger", | ||
@@ -24,3 +24,3 @@ "main": "index.js", | ||
"es6-error": "^4.0.2", | ||
"function-tree": "^3.3.0-1536860951275" | ||
"function-tree": "^3.3.0-1536863128047" | ||
}, | ||
@@ -27,0 +27,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
787365
7899