Skip to content

Commit 19f6b93

Browse files
authored
Merge pull request #890 from princerafid01/zustand-receipe
Zustand receipe
2 parents 5fe9686 + 40bae46 commit 19f6b93

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

data/zustand-cheatsheet.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,28 @@
8080
"code": "create<State>()(...)"
8181
}
8282
]
83-
}
83+
},
84+
{
85+
"title": "যুস্ট্যান্ড এর কিছু রেসিপি ",
86+
"items": [
87+
{
88+
"definition": "স্টোরের সবকিছু নিয়ে আসা",
89+
"code": "const state = useBearStore()"
90+
},
91+
{
92+
"definition": "সিলেক্টিং মাল্টিপল স্টেট স্লাইস ",
93+
"code": "const nuts = useBearStore((state) => state.nuts); const honey = useBearStore((state) => state.honey)"
94+
},
95+
{
96+
"definition": "স্টেট কে মার্জ না করে পুরো পরিবর্তন করে ফেলতে চাইলে মিউটেশনের set ফাংশনে আপনার সেকেন্ড প্যারামিটার পাস করতে হবে এভাবে ",
97+
"code": "() => set({}, true), // clears the entire store, actions included"
98+
},
99+
{
100+
"definition": "Async একশন",
101+
"code": "fetch: async (pond) => { const response = await fetch(pond) set({ fishies: await response.json() }) },"
102+
}
103+
]
104+
}
84105

85106
]
86107
}

0 commit comments

Comments
 (0)