const user = store.getSate().user;
const { user } = useStoreState('user')
const createUser = store.action(createUser(store));
createUser(userId);store.setState({ user: ... });const { createUser } = useActions(Actions)
createUser(userId);const Component = ({ apple }: any): any => {
const { eatFruit } = useAction(Actions);
const [fruitColor, setFruitTaste] = useState<Generic>(0);
const { user } = useAauth0();
const onClick = (): any => {
const changeData = async () => {
eatFruit()
store.setState({ fruitTaste: null });
setFruitTaste(null);
}
changeData();
}
return (
<Banana
fruit={fruitColor ? apple : undefined}
toggle={(e) => onClick(e)}
/>
)
}
const Component = ({ apple }: any): any => {
const { eatFruit } = useAction(Actions);
const [fruitColor, setFruitTaste] = useState<Generic>(0);
const { user } = useAauth0();
const onClick = (): any => {
const changeData = async () => {
eatFruit()
store.setState({ fruitTaste: null });
setFruitTaste(null);
}
changeData();
}
return (
<Banana
fruit={fruitColor ? apple : undefined}
toggle={(e) => onClick(e)}
/>
)
}
const Component = ({ apple }: any): any => {
const { eatFruit } = useAction(Actions);
const [fruitColor, setFruitTaste] = useState<Generic>(0);
const { user } = useAauth0();
const onClick = (): any => {
const changeData = async () => {
eatFruit()
store.setState({ fruitTaste: null });
setFruitTaste(null);
}
changeData();
}
return (
<Banana
fruit={fruitColor ? apple : undefined}
toggle={(e) => onClick(e)}
/>
)
}