i have a SignalStore with 2 Arrays and 2 API Calls. Can i combine the 2 Arrays to 1 and can get the Data? So that i can use PVVormat.[0]. and PVVormonat.[1] with the data from the 2 API Calls?
export const AktuellerMonatStore = signalStore(
withState(monatGesamt),
withRequestStatus(),
withMethods((store, dbService = inject(DBService)) => ({
loadDaten: rxMethod<void>(
pipe(
switchMap(() => {
patchState(store, setPending());
return dbService.getMonatGesamt('' + aktJahr + '', '' + monat + '').pipe(
tapResponse({
next: (pvVorjahr) =>
patchState(store, { pvVorjahr }, setFulFilled()),
error: (error: {message:string}) => {
patchState(store, setError(error.message));
}
})
)
})
)
),
loadDatenVorjahr: rxMethod<void>(
pipe(
switchMap(() => {
patchState(store, setPending());
return dbService.getMonatGesamt('' + aktJahr + '', '' + monat + '').pipe(
tapResponse({
next: (pvVormonat) =>
patchState(store, { pvVormonat }, setFulFilled()),
error: (error: {message:string}) => {
patchState(store, setError(error.message));
}
})
)
})
)
)
}))
Thx