app-redux-utils
Advanced tools
Comparing version 1.5.0 to 1.5.1
# Changelog | ||
### 1.5.1 | ||
* add `WatchedController` type; | ||
### 1.5.0 | ||
@@ -4,0 +8,0 @@ |
@@ -33,3 +33,6 @@ import { Action as ReduxAction } from 'redux'; | ||
declare type DecoratedWatchedController<Watchers extends readonly any[]> = SimpleActions<Watchers> & ComplexAction<Watchers>; | ||
export type { Controller, Action, ActionWithCallback, CallbackAction, Constructor, WatchedConstructor, DecoratedWatchedController, }; | ||
declare type WatchedController<TController extends Controller> = { | ||
[methodName in keyof TController]: TController[methodName] extends (...args: any) => any ? Parameters<TController[methodName]>[0] extends Action<infer ActionType> ? (param: ActionType) => void : TController[methodName] : never; | ||
}; | ||
export type { Controller, Action, ActionWithCallback, CallbackAction, Constructor, WatchedConstructor, DecoratedWatchedController, WatchedController, }; | ||
export { isAction }; |
{ | ||
"name": "app-redux-utils", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Helpful utils for redux", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -304,3 +304,3 @@ * [install](#Installation) | ||
```tsx | ||
import { ControllerBase, DecoratedWatchedController, Reducer, createAction } from 'app-redux-utils'; | ||
import { ControllerBase, DecoratedWatchedController, Reducer, createAction, WatchedController } from 'app-redux-utils'; | ||
import { useDispatch } from 'react-redux'; | ||
@@ -330,2 +330,3 @@ | ||
} | ||
const myController: DecoratedWatchedController<[ | ||
@@ -336,2 +337,5 @@ 'loadUsers' | | ||
// if you use the same name for all Controller methods (like `@watch addUser(action: ...) {...}`) | ||
// const myController: WatchedController<MyController> = MyController as any; | ||
export { myController as MyController }; | ||
@@ -338,0 +342,0 @@ ``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55972
656
453