Skip to content

Commit 0ebe013

Browse files
committed
Update readme and clean up
1 parent efacf0c commit 0ebe013

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Live demo: [https://kosha-six.vercel.app](https://kosha-six.vercel.app)
2626
- [❓ FAQ](#-faq)
2727
- [🚧 Known Limitations](#-known-limitations)
2828
- [🤝 Contributing](#-contributing)
29+
- [🧪 Testing and Mocking](#-testing-and-mocking)
30+
- [🧠 Internals & Caveats](#-internals--caveats)
2931
- [📜 License](#-license)
3032

3133
---

lib/tests/with-selectors/counter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useRef } from "react";
22
import { useMyKosha } from "./store";
33

44
export function Counter() {
5-
const [count, setCount] = useMyKosha(state => [state.count, state.setCount] as const);
5+
const [count, setCount] = useMyKosha(state => [state.count, state.setCount]);
66
const renderCount = useRef(0);
77
renderCount.current++;
88
return (

packages/shared/src/client/demo/compare/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const P1ExtractAsObj = ({ type }: StoreTypeProps) => {
4343
};
4444

4545
const P1ExtractAsArray = ({ type }: StoreTypeProps) => {
46-
const [p1, setP1] = getStore(type)(({ p1, setP1 }) => [p1, setP1] as const);
46+
const [p1, setP1] = getStore(type)(({ p1, setP1 }) => [p1, setP1]);
4747
return <P1 {...{ p1, setP1 }} />;
4848
};
4949

@@ -59,7 +59,7 @@ const P2ExtractAsObj = ({ type }: StoreTypeProps) => {
5959
};
6060

6161
const P2ExtractAsArray = ({ type }: StoreTypeProps) => {
62-
const [p2, setP2] = getStore(type)(({ p2, setP2 }) => [p2, setP2] as const);
62+
const [p2, setP2] = getStore(type)(({ p2, setP2 }) => [p2, setP2]);
6363
return <P2 {...{ p2, setP2 }} />;
6464
};
6565

@@ -79,7 +79,7 @@ export const Compare = () => (
7979
<P2ExtractAsObj type="kosha" />
8080
<hr />
8181
<h4>Extract as Array</h4>
82-
<code>{`const [p2, setP2] = myStore(({ p2, setP2 }) => [p2, setP2] as const)`}</code>
82+
<code>{`const [p2, setP2] = myStore(({ p2, setP2 }) => [p2, setP2] )`}</code>
8383
<P1ExtractAsArray type="kosha" />
8484
<P2ExtractAsArray type="kosha" />
8585
<hr />
@@ -100,7 +100,7 @@ export const Compare = () => (
100100
</ErrorBoundary>
101101
<hr />
102102
<h4>Extract as Array</h4>
103-
<code>{`const [p2, setP2] = myStore(({ p2, setP2 }) => [p2, setP2] as const)`}</code>
103+
<code>{`const [p2, setP2] = myStore(({ p2, setP2 }) => [p2, setP2] )`}</code>
104104
<ErrorBoundary fallback={<p>⚠️Something went wrong</p>}>
105105
<P1ExtractAsArray type="zustand" />
106106
</ErrorBoundary>

packages/shared/src/client/demo/with-selectors/counter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useRef } from "react";
22
import { useMyKosha } from "./store";
33

44
export function Counter() {
5-
const [count, setCount] = useMyKosha(state => [state.count, state.setCount] as const);
5+
const [count, setCount] = useMyKosha(state => [state.count, state.setCount]);
66
const renderCount = useRef(0);
77
renderCount.current++;
88
return (

0 commit comments

Comments
 (0)