Skip to content

Commit

Permalink
fix: handle undefined adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
mbret committed Jul 16, 2024
1 parent d0e719d commit 8577eb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/state/persistance/usePersistSignals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function usePersistSignals({
* process will start again. This is useful when you
* need to change adapter during runtime.
*/
adapter: Adapter
adapter?: Adapter
}) {
const entriesRef = useLiveRef(entries)
const onReadyRef = useLiveRef(onReady)
Expand All @@ -110,7 +110,7 @@ export function usePersistSignals({
return adapterSubject.current.pipe(
switchMap((adapterInstance) => {
const stream =
entries.length === 0
entries.length === 0 || !adapterInstance
? of(true)
: zip(
...entries.map((config) =>
Expand Down

0 comments on commit 8577eb1

Please sign in to comment.