Socket
Socket
Sign inDemoInstall

zustand-debounce

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    zustand-debounce

zustand-debounce is a library that extends the capabilities of [Zustand](https://github.com/pmndrs/zustand) to provide a JSON state storage system with delayed (debounced) writing to storage. With this tool, you can reduce the number of write operations t


Version published
Weekly downloads
31
decreased by-6.06%
Maintainers
1
Install size
4.58 kB
Created
Weekly downloads
 

Readme

Source

Zustand Debounce

zustand-debounce is a library that extends the capabilities of Zustand to provide a JSON state storage system with delayed (debounced) writing to storage. With this tool, you can reduce the number of write operations to storage by delaying and grouping them.

✅ 🐙 Lightweight!! 367 B gzipped.

✅ 🚀 Easy integration into your projects.

✅ 🕒 Customize the debounce time according to your needs.

✅ 🔄 Avoid frequent writes to storage.

✅ Full TypeScript support.

Installation

pnpm add zustand-debounce
# o
npm install zustand-debounce
# o
yarn add zustand-debounce

Usage

import { createDebouncedJSONStorage } from "zustand-debounce"

// Replace createJSONStorage with createDebouncedJSONStorage
// Experience the enchantment of delayed writes ✨
export const usePersonStore = create<PersonState & Actions>()(
  persist(storeApi, {
    name: "person-storage",
    storage: createDebouncedJSONStorage(firebaseStorage, {
      debounceTime: 2000, // Debounce time in milliseconds ⏳
    }),
  }),
)

Contributions

Contributions are welcome. If you find an issue or have an idea to improve zustand-debounce, feel free to open an issue or submit a pull request.

License 📜

Licensed as MIT open source.


with 💖 by AbianS

Keywords

FAQs

Last updated on 14 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc