Skip to content

Commit

Permalink
fix: default reactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
afiiif committed Oct 9, 2023
1 parent e923c0e commit 51804ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/react/create-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const createStore = <T extends StoreData>(
});
};

const Watch = ({ selectDeps, render }: WatchProps<T>) => {
const Watch = ({ selectDeps = defaultDeps, render }: WatchProps<T>) => {
const store = useStore(selectDeps);
return render(store);
};
Expand Down
6 changes: 5 additions & 1 deletion src/react/create-stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ export const createStores = <TKey extends StoreKey = StoreKey, T extends StoreDa
});
};

const Watch = ({ storeKey, selectDeps, render }: WatchProps<T> & { storeKey?: Maybe<TKey> }) => {
const Watch = ({
storeKey,
selectDeps = defaultDeps,
render,
}: WatchProps<T> & { storeKey?: Maybe<TKey> }) => {
const store = useStores(storeKey, selectDeps);
return render(store);
};
Expand Down

0 comments on commit 51804ba

Please sign in to comment.