JSPM

zustand-log-and-expose

0.3.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q45854F
  • License MIT

Zustand middleware for logging and exposing stores

Package Exports

  • zustand-log-and-expose

Readme

Log and expose middleware for zustand

This is the middleware for Zustand state manager that logs store changes in console and exposes them in window object.

Usage is simple:

const logAndExpose = createLogAndExposeMiddleware({
    logFunction(...args) {
        console.log("Prefix", ...args);
    },
});

Then use logAndExpose variable as middleware.

You can use any kind of logger function.

Exposed stores are available through window._zustand after any change of store.