Think Throothinkthroo.hashnode.dev·10 hours agouseBoundStoreWithEqualityFn in Zustand’s source code explained.In this article, we will understand how the useBoundStoreWithEqualityFn function is used in Zustand’s source code. The above code is picked from https://github.com/pmndrs/zustand/blob/main/src/traditional.ts#L80 useBoundStoreWithEqualityFn is called...DiscussJavaScript
Think Throothinkthroo.hashnode.dev·Sep 9, 2024useSyncExternalStoreExports in Zustand source code explained.In this article, we will look at how Zustand uses useSyncExternalStoreExports in its source code. useSyncExternalStoreExports is imported from use-sync-external-store/shim/with-selector. use-sync-external-store is a backwards-compatible shim for Rea...DiscussJavaScript
Think Throothinkthroo.hashnode.dev·Sep 6, 2024createStore in Zustand's source code explained.In this article, we will understand how createStore in Zustand’s source code is written/works. createStore is exported from vanilla.ts and you will find this at the end of the file. export const createStore = ((createState) => createState ? create...DiscussJavaScript
Think Throothinkthroo.hashnode.dev·Sep 4, 2024Object.assign() usage in Zustand's source code.In this article, we will understand how Object.assign() is used in Zustand’s source code. The above code snippet is from vanilla.ts, when you set a state, Object.assign is used to update your state object. Let’s first understand the basics of Object...Discusszustand
Think Throothinkthroo.hashnode.dev·Sep 3, 2024Set() usage in Zustand’s source code.In this article, we will understand how Set() method is used in Zustand’s source code. so the listeners in Zustand are basically a Set. The above code snippet is picked from vanilla.ts Set The Set object lets you store unique values of any type, whe...DiscussJavaScript
Think Throothinkthroo.hashnode.dev·Sep 2, 2024Object.is() usage in Zustand's source codeIn this article, we will explore how Object.is() method is used in Zustand’s source code. The above code snippet is picked from vanilla.ts Object.is() method is used in setState (more articles on this later on). Let’s first understand what an Objec...Discusszustand
Saiful Alamblog.msar.me·Jul 16, 2024Understanding Zustand: A Lightweight State Management Library for ReactState management is a crucial aspect of building robust and scalable React applications. While there are numerous state management libraries available, Zustand has emerged as a lightweight and flexible alternative that provides a simple yet powerful ...Discuss·80 readsJavaScriptReact
Peter Abahoddabok.hashnode.dev·Jun 29, 2024Redux vs Zustand: Managing state in React applications.Introduction State management is critical when building front-end applications with React. As your application gets more complex, it becomes crucial to organize your app state and keep the data flows between your components simple. A common approach ...DiscussReact
Dipankar Pauliamdipankarpaul.hashnode.dev·Jun 21, 2024ReAPI Client: A Comprehensive Guide to My React API Request BuilderIntroduction Welcome to my blog! I'm Dipankar Paul, a frontend developer with a passion for creating efficient and user-friendly web applications. In this article, I will take you through one of my projects, the ReAPI Client. This React-based API req...Discuss·16 likes·43 readsProjectsReact
Kanishk Sankpalishqelliot.hashnode.dev·Jun 17, 2024Underrated React API - useSyncExternalStore and Understanding ZustandIntention - Either React's effort in useSyncExternalStore or the recent innovation in state management libraries; the underlying idea was the same. How to avoid unessential re-renders (caused while managing the state)? useSyncExternalStore: This api...Discuss·40 readsReact