File tree Expand file tree Collapse file tree 2 files changed +1
-7
lines changed
Expand file tree Collapse file tree 2 files changed +1
-7
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " reducer-class" ,
3- "version" : " 1.2.0 " ,
3+ "version" : " 1.2.1 " ,
44 "description" : " Boilerplate free class-based reducer creator. Built with TypeScript. Works with Redux and NGRX. Has integration with immer." ,
55 "main" : " dist/index.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ export interface IAction {
77export type IActionCreator = ( ...args : any [ ] ) => IAction
88export type IActionConstructor = new ( ...args : any [ ] ) => IAction
99const isArrowFunction = ( action : IActionConstructor | IActionCreator ) : action is IActionCreator => ! action . prototype
10- const isES6Class = ( action : IActionConstructor | IActionCreator ) : boolean => action . toString ( ) . indexOf ( 'class' ) === 0
1110const typeGuardActionHasOwnType = ( action : IAction | IActionConstructor | IActionCreator ) : action is IAction =>
1211 typeof ( action as IAction ) . type === 'string' // tslint:disable-line strict-type-predicates
1312const typeGuardActionIsString = ( action : IAction | IActionConstructor | IActionCreator | string ) : action is string =>
@@ -20,11 +19,6 @@ const getActionType = (action: IAction | IActionConstructor | IActionCreator | s
2019 if ( typeGuardActionHasOwnType ( action ) ) {
2120 return action . type
2221 }
23- // ES6 classes can not be invoked without `new` so we handle them separately
24- if ( isES6Class ( action ) ) {
25- const classInstance = new ( action as IActionConstructor ) ( )
26- return classInstance . type
27- }
2822 try {
2923 if ( isArrowFunction ( action ) ) {
3024 const actionCreatorArrowFnRes = action ( )
You can’t perform that action at this time.
0 commit comments