@angular-architects/ngrx-toolkit
Advanced tools
Comparing version 0.1.2 to 0.3.0
@@ -1,2 +0,2 @@ | ||
export { withDevtools, patchState, Action } from './lib/with-devtools'; | ||
export { withDevtools, patchState, updateState, Action, } from './lib/with-devtools'; | ||
export * from './lib/with-redux'; | ||
@@ -3,0 +3,0 @@ export * from './lib/with-call-state'; |
@@ -7,14 +7,7 @@ import { Signal } from '@angular/core'; | ||
}; | ||
export type NamedCallStateSlice<Collection extends string> = { | ||
[K in Collection as `${K}CallState`]: CallState; | ||
}; | ||
export type CallStateSlice = { | ||
callState: CallState; | ||
}; | ||
export type NamedCallStateSignals<Prop extends string> = { | ||
[K in Prop as `${K}Loading`]: Signal<boolean>; | ||
} & { | ||
[K in Prop as `${K}Loaded`]: Signal<boolean>; | ||
} & { | ||
[K in Prop as `${K}Error`]: Signal<string | null>; | ||
export type NamedCallStateSlice<Collection extends string> = { | ||
[K in keyof CallStateSlice as `${Collection}${Capitalize<K>}`]: CallStateSlice[K]; | ||
}; | ||
@@ -26,2 +19,5 @@ export type CallStateSignals = { | ||
}; | ||
export type NamedCallStateSignals<Prop extends string> = { | ||
[K in keyof CallStateSignals as `${Prop}${Capitalize<K>}`]: CallStateSignals[K]; | ||
}; | ||
export type SetCallState<Prop extends string | undefined> = Prop extends string ? NamedCallStateSlice<Prop> : CallStateSlice; | ||
@@ -28,0 +24,0 @@ export declare function getCallStateKeys(config?: { |
@@ -31,3 +31,14 @@ import { patchState as originalPatchState, SignalStoreFeature } from '@ngrx/signals'; | ||
type PatchFn = typeof originalPatchState extends (arg1: infer First, ...args: infer Rest) => infer Returner ? (state: First, action: string, ...rest: Rest) => Returner : never; | ||
/** | ||
* @deprecated Has been renamed to `updateState` | ||
*/ | ||
export declare const patchState: PatchFn; | ||
/** | ||
* Wrapper of `patchState` for DevTools integration. Next to updating the state, | ||
* it also sends the action to the DevTools. | ||
* @param state state of Signal Store | ||
* @param action name of action how it will show in DevTools | ||
* @param updaters updater functions or objects | ||
*/ | ||
export declare const updateState: PatchFn; | ||
export {}; |
@@ -15,4 +15,6 @@ import { Observable } from 'rxjs'; | ||
type ActionFnCreator<Spec extends ActionsFnSpecs> = { | ||
[ActionName in keyof Spec]: ((payload: Spec[ActionName]) => Spec[ActionName] & { | ||
[ActionName in keyof Spec]: (Record<never, never> extends Spec[ActionName] ? () => Spec[ActionName] & { | ||
type: ActionName; | ||
} : (payload: Spec[ActionName]) => Spec[ActionName] & { | ||
type: ActionName; | ||
}) & { | ||
@@ -19,0 +21,0 @@ type: ActionName & string; |
{ | ||
"name": "@angular-architects/ngrx-toolkit", | ||
"version": "0.1.2", | ||
"version": "0.3.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
260375
1820
0