Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Commit

Permalink
✏️ Fix minor typo in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
amoutonbrady committed Dec 30, 2020
1 parent 7aa6fbe commit 7457ea7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,18 @@ Not setting the third parameters prevent typescript to infer the proper types fo
If any Typescript ninja come accross this I'd be more than happy to know the right way to do that...

```tsx
const [Provider, useProvider] = createStore<{ count: number }>(
(props) => ({ count: props.count, first: 'Alexandre' }),
const [Provider, useProvider] = createStore<{ count: number }>({
state: (props) => ({ count: props.count, first: 'Alexandre' }),

(set, get) => ({
actions: (set, get) => ({
increment(by = 1) {
set('count', count => count + 1)
},
dynamicFullName(last) {
return `${get.first} ${last} ${get.count}`;
}
})
)
})

const Counter = () => {
const [state, { increment, dynamicFullName }] = useProvider()
Expand Down

0 comments on commit 7457ea7

Please sign in to comment.