Skip to content

Commit fb77141

Browse files
committed
chore(withResource): replace some as records with explicit types
1 parent 8918810 commit fb77141

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libs/ngrx-toolkit/src/lib/with-resource.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,33 +187,33 @@ function createNamedResource<Dictionary extends ResourceDictionary>(
187187
) {
188188
const keys = Object.keys(dictionary);
189189

190-
const state = keys.reduce(
190+
const state: Record<string, WritableSignal<unknown>> = keys.reduce(
191191
(state, resourceName) => ({
192192
...state,
193193
[`${resourceName}Value`]: dictionary[resourceName].value,
194194
}),
195-
{} as Record<string, WritableSignal<unknown>>,
195+
{},
196196
);
197197

198-
const props = keys.reduce(
198+
const props: Record<string, Signal<unknown>> = keys.reduce(
199199
(props, resourceName) => ({
200200
...props,
201201
[`${resourceName}Status`]: dictionary[resourceName].status,
202202
[`${resourceName}Error`]: dictionary[resourceName].error,
203203
[`${resourceName}IsLoading`]: dictionary[resourceName].isLoading,
204204
}),
205-
{} as Record<string, Signal<unknown>>,
205+
{},
206206
);
207207

208-
const methods = keys.reduce(
208+
const methods: Record<string, () => boolean> = keys.reduce(
209209
(methods, resourceName) => {
210210
return {
211211
...methods,
212212
[`${resourceName}HasValue`]: () => dictionary[resourceName].hasValue(),
213213
[`_${resourceName}Reload`]: () => dictionary[resourceName].reload(),
214214
};
215215
},
216-
{} as Record<string, () => boolean>,
216+
{},
217217
);
218218

219219
return signalStoreFeature(

0 commit comments

Comments
 (0)