fix(angular): fix broken data persistence normalize action function (#8453)

This commit is contained in:
Miroslav Jonaš 2022-01-10 11:41:03 +01:00 committed by GitHub
parent 5549ded23f
commit 6fc5bbe931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,10 +163,7 @@ function runWithErrorHandling<T extends Array<unknown>, A, R>(
function mapActionAndState<T extends Array<unknown>, A>() {
return (source: Observable<ActionOrActionWithStates<T, A>>) => {
return source.pipe(
map((value) => {
const [action, ...store] = normalizeActionAndState(value);
return [action, ...store] as [A, ...T];
})
map((value) => normalizeActionAndState(value) as [A, ...T])
);
};
}
@ -183,6 +180,7 @@ function normalizeActionAndState<T extends Array<unknown>, A>(
if (args instanceof Array) {
[action, ...slices] = args;
} else {
slices = [] as T;
action = args;
}