Skip to content

aylonmuramatsu/reactotron-zustand-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

ko-fi

reactotron-zustand-plugin

Simple Plugin to monitor states from zustand.

How install a project:

yarn add https://github.com/aylonmuramatsu/reactotron-zustand-plugin.git

or

npm i https://github.com/aylonmuramatsu/reactotron-zustand-plugin.git --save

How use? Go to file "Reactotron.config.js" or your config reactotron from project, is similar to this file:

import reactotronZustand from "reactotron-plugin-zustand";

Reactotron.setAsyncStorageHandler(AsyncStorage) // AsyncStorage would either come from `react-native` or `@react-native-community/async-storage` depending on where you get it from
  .configure({
    name: 'Name Project',
  }) // controls connection & communication settings
  .useReactNative() // add all built-in react native plugins
  .use(
    //add this line 🙌
    reactotronZustand({
      stores: [
        { name: 'app', zustand: useApp },
        { name: 'authentication', zustand: useAuth },
      ],
    })
  ) // plus some custom made plugin.
  .connect(); // let's connect!

In case , i use two stores: "useApp" and "useAuth", each your stores should has fields "name" & "zustand"

name = name of store, this is show on reactotron

zustand = your store

Captura de Tela 2023-06-22 às 23 59 47

Don't forget to add the observers!

Captura de Tela 2023-06-23 às 00 09 08

You can watch states by individual or all state using: "*", "root" , "all"

About

Simple Plugin to monitor states from zustand.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published