Skip to content

Commit

Permalink
#111 fix(rx-stateful): fix that initially refresh trigger and sharedS…
Browse files Browse the repository at this point in the history
…ource$ emit multiple values
  • Loading branch information
michaelbe812 committed Jul 25, 2024
1 parent bb5bb6f commit 7355776
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libs/rx-stateful/src/lib/rx-stateful$.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,19 @@ function createState$<T,A, E>(
*/
// @ts-ignore todo
refreshTriggerIsBehaivorSubject(mergedConfig) ? skip(1) : pipe(),
// @ts-ignore
switchMap(() =>
sharedSource$.pipe(
map(v => mapToValue(v)),
deriveInitialValue<T,E>(mergedConfig)
),
),
share({
connector: () => new ReplaySubject(1),
resetOnError: true,
resetOnComplete: true,
resetOnRefCountZero: true,
}),
) as Observable<Partial<InternalRxState<T, E>>>


Expand Down

0 comments on commit 7355776

Please sign in to comment.