Skip to content
Myr

Update use-shallow.md (#3004)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Loco · committed by GitHub · parent 57608bb · Browse files · 1 file+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:docs/hooks/use-shallow.md+4 added-4 removed
88 unmodified lines
89function UpdateBabyBearMeal() {90 useEffect(() => {91 const timer = setInterval(() => {92 useBearFamilyMealsStore.setState({93 tinyBear: meals[Math.floor(Math.random() * (meals.length - 1))],93 babyBear: meals[Math.floor(Math.random() * (meals.length - 1))],94 })95 }, 1000)9697 return () => {
10 unmodified lines
108```tsx109export default function App() {110 return (111 <>112 <UpdateTinyBearPorridge />112 <UpdateBabyBearPorridge />113 <BearNames />114 </>115 )116}
31 unmodified lines
148function UpdateBabyBearMeal() {149 useEffect(() => {150 const timer = setInterval(() => {151 useBearFamilyMealsStore.setState({152 tinyBear: meals[Math.floor(Math.random() * (meals.length - 1))],152 babyBear: meals[Math.floor(Math.random() * (meals.length - 1))],153 })154 }, 1000)155156 return () => {
68 unmodified lines
225function UpdateBabyBearMeal() {226 useEffect(() => {227 const timer = setInterval(() => {228 useBearFamilyMealsStore.setState({229 tinyBear: meals[Math.floor(Math.random() * (meals.length - 1))],229 babyBear: meals[Math.floor(Math.random() * (meals.length - 1))],230 })231 }, 1000)232233 return () => {
31 unmodified lines