Skip to content

Commit

Permalink
update useSelector type
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Aug 15, 2024
1 parent 175c0bd commit 9a02d5b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/zustand-query/src/react/useSelector.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useEffect, useRef, useState } from "react";
import { State, Store } from "../common";
import { State, Store, StoreConfig } from "../common";
import { subscribeStore } from "../actions";

export function useSelector<store extends Store, T>(
store: store,
selector: (store: State) => T,
export function useSelector<config extends StoreConfig, T>(
store: Store<config>,

This comment has been minimized.

Copy link
@holic

holic Aug 15, 2024

Member

can't wait for "stash" rename to clarify this

selector: (store: State<config>) => T,
equals: (a: T, b: T) => boolean = (a, b) => a === b,
): T {
const state = useRef(selector(store.get()));
Expand Down

0 comments on commit 9a02d5b

Please sign in to comment.