Comparing version 2.3.2 to 2.3.3
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
## 2.3.3 - 2021-03-01 | ||
- Add generics to the `BuiltLogic<logicType>` and `LogicWrapper<logicType>` types. | ||
## 2.3.2 - 2021-02-14 | ||
@@ -5,0 +8,0 @@ - Fix edge case error when removing listeners (@zshannon [#108](https://github.com/keajs/kea/pull/108/files)) |
@@ -897,3 +897,3 @@ 'use strict'; | ||
throw new Error("[KEA] Can not find path \"" + path.join('.') + "\" in the redux store."); | ||
throw new Error("[KEA] Can not find path \"" + path.join('.') + "\" in the store."); | ||
}); | ||
@@ -1269,6 +1269,8 @@ } | ||
Object.keys(listeners).forEach(function (action) { | ||
delete byAction[action][pathString]; | ||
if (byAction[action]) { | ||
delete byAction[action][pathString]; | ||
if (Object.keys(byAction[action]).length === 0) { | ||
delete byAction[action]; | ||
if (Object.keys(byAction[action]).length === 0) { | ||
delete byAction[action]; | ||
} | ||
} | ||
@@ -1275,0 +1277,0 @@ }); |
@@ -57,4 +57,4 @@ import { AnyAction, Reducer, Middleware, compose, StoreEnhancer, Store, Action } from 'redux'; | ||
} | ||
declare type BuiltLogic = Logic & BuiltLogicAdditions<Logic>; | ||
declare type LogicWrapper = Logic & LogicWrapperAdditions<Logic>; | ||
declare type BuiltLogic<LogicType extends Logic = Logic> = LogicType & BuiltLogicAdditions<LogicType>; | ||
declare type LogicWrapper<LogicType extends Logic = Logic> = LogicType & LogicWrapperAdditions<LogicType>; | ||
declare type ActionDefinitions<LogicType extends Logic> = Record<string, any | (() => any)> | LogicType['actionCreators']; | ||
@@ -61,0 +61,0 @@ declare type ReducerActions<LogicType extends Logic, ReducerType> = { |
@@ -893,3 +893,3 @@ import { createSelector } from 'reselect'; | ||
throw new Error("[KEA] Can not find path \"" + path.join('.') + "\" in the redux store."); | ||
throw new Error("[KEA] Can not find path \"" + path.join('.') + "\" in the store."); | ||
}); | ||
@@ -1265,6 +1265,8 @@ } | ||
Object.keys(listeners).forEach(function (action) { | ||
delete byAction[action][pathString]; | ||
if (byAction[action]) { | ||
delete byAction[action][pathString]; | ||
if (Object.keys(byAction[action]).length === 0) { | ||
delete byAction[action]; | ||
if (Object.keys(byAction[action]).length === 0) { | ||
delete byAction[action]; | ||
} | ||
} | ||
@@ -1271,0 +1273,0 @@ }); |
@@ -56,4 +56,4 @@ import { Reducer, Store, Action as ReduxAction, Middleware, StoreEnhancer, compose, AnyAction } from 'redux'; | ||
} | ||
export declare type BuiltLogic = Logic & BuiltLogicAdditions<Logic>; | ||
export declare type LogicWrapper = Logic & LogicWrapperAdditions<Logic>; | ||
export declare type BuiltLogic<LogicType extends Logic = Logic> = LogicType & BuiltLogicAdditions<LogicType>; | ||
export declare type LogicWrapper<LogicType extends Logic = Logic> = LogicType & LogicWrapperAdditions<LogicType>; | ||
declare type ActionDefinitions<LogicType extends Logic> = Record<string, any | (() => any)> | LogicType['actionCreators']; | ||
@@ -60,0 +60,0 @@ declare type ReducerActions<LogicType extends Logic, ReducerType> = { |
{ | ||
"name": "kea", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"description": "Smart front-end architecture", | ||
@@ -5,0 +5,0 @@ "author": "Marius Andra", |
@@ -64,4 +64,4 @@ import { Reducer, Store, Action as ReduxAction, Middleware, StoreEnhancer, compose, AnyAction } from 'redux' | ||
export type BuiltLogic = Logic & BuiltLogicAdditions<Logic> | ||
export type LogicWrapper = Logic & LogicWrapperAdditions<Logic> | ||
export type BuiltLogic<LogicType extends Logic = Logic> = LogicType & BuiltLogicAdditions<LogicType> | ||
export type LogicWrapper<LogicType extends Logic = Logic> = LogicType & LogicWrapperAdditions<LogicType> | ||
@@ -68,0 +68,0 @@ // input helpers (using the generated logic type as input) |
280178
7022