Skip to content

v0.0.18

Compare
Choose a tag to compare
@ityuany ityuany released this 07 Nov 06:59
· 203 commits to main since this release
9d498a8

Break change

Now , useSnapshot return value is no longer completely new each time. In the unchanged situation, the previous proxy object will be used again.

This means that you can write the following code normally.

import { store } from "./store";

export default function Foo() {

  const snap = store.useSnapshot();

  useEffect(() => {
    console.log(address);
  }, [snap.user.address]);

  return (
    <>
      <h1>{state.name}</h1>
    </>
  );
}