redux-state-branch
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -29,3 +29,3 @@ export declare const makeType: (prefix: string, suffix?: string | undefined) => string; | ||
constructor(name: string); | ||
byId(state: IState, id: ID): T | void; | ||
byId(state: IState, id?: ID): T | void; | ||
all(state: IState): T[]; | ||
@@ -32,0 +32,0 @@ where(state: IState, condition: (item: ItemT<T>) => boolean): T[]; |
@@ -32,3 +32,3 @@ var __assign = (this && this.__assign) || function () { | ||
Selectors.prototype.byId = function (state, id) { | ||
return state[this.name].items[id]; | ||
return state[this.name].items[id || ""]; | ||
}; | ||
@@ -95,13 +95,6 @@ Selectors.prototype.all = function (state) { | ||
function StateBranch(_a) { | ||
var name = _a.name, _b = _a.actions, ActionsConstructor = _b === void 0 ? Actions : _b, _c = _a.selectors, SelectorsConstructor = _c === void 0 ? Selectors : _c, | ||
// @ts-ignore | ||
_d = _a.constants, | ||
// @ts-ignore | ||
constants = _d === void 0 ? {} : _d, | ||
// @ts-ignore | ||
_e = _a.utils, | ||
// @ts-ignore | ||
utils = _e === void 0 ? {} : _e, _f = _a.defaultItem, defaultItem = _f === void 0 ? {} : _f, _g = _a.defaultState, defaultState = _g === void 0 ? { items: {} } : _g, _h = _a.reducer, reducer = _h === void 0 ? function (state, action) { return state; } : _h; | ||
var name = _a.name, _b = _a.actions, ActionsConstructor = _b === void 0 ? Actions : _b, _c = _a.selectors, SelectorsConstructor = _c === void 0 ? Selectors : _c, constants = _a.constants, utils = _a.utils, _d = _a.defaultItem, defaultItem = _d === void 0 ? {} : _d, _e = _a.defaultState, defaultState = _e === void 0 ? { items: {} } : _e, _f = _a.reducer, reducer = _f === void 0 ? function (state, action) { return state; } : _f; | ||
this.name = name; | ||
this.constant = __assign({}, constants, { CREATE: name + "/CREATE", REPLACE: name + "/REPLACE", UPDATE: name + "/UPDATE", DELETE: name + "/DELETE", SET_META: name + "/SET_META", RESET: name + "/RESET" }); | ||
// @ts-ignore | ||
this.util = utils; | ||
@@ -108,0 +101,0 @@ this.action = new ActionsConstructor(this.constant); |
{ | ||
"name": "redux-state-branch", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "A redux wrapper for sane people.", |
Sorry, the diff of this file is not supported yet
22937
467