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](https://private-user-images.githubusercontent.com/28609474/248142691-81e12c1f-4d33-4575-930a-14419aa508bf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM2MTg5NzcsIm5iZiI6MTcyMzYxODY3NywicGF0aCI6Ii8yODYwOTQ3NC8yNDgxNDI2OTEtODFlMTJjMWYtNGQzMy00NTc1LTkzMGEtMTQ0MTlhYTUwOGJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE0VDA2NTc1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThkZGY5OWYyZGIxMGZmMGNkZDI1OTNmNTBiYWIxNzEwYmM0YTc1NGMxYWI2NzQwNWU1OTFhYzA2YzhkMDViOWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zhdAQxIAGO5wohO7sXOcbX30r1mo1KNA6sqZZB4WbCs)
Don't forget to add the observers!
![Captura de Tela 2023-06-23 às 00 09 08](https://private-user-images.githubusercontent.com/28609474/248143772-90228598-c881-4a77-aca3-23e1c6c47549.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM2MTg5NzcsIm5iZiI6MTcyMzYxODY3NywicGF0aCI6Ii8yODYwOTQ3NC8yNDgxNDM3NzItOTAyMjg1OTgtYzg4MS00YTc3LWFjYTMtMjNlMWM2YzQ3NTQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE0VDA2NTc1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFiMTdhOGY4MGQwM2JmZDdiOGNlZmYzMTJmNzYzMTNlY2Y3OTNhM2Q5MTAxODE5ZDgzYzhmNjllYzY1MzZhNzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hIHv63uZyOe-efZF89jaB1Ab4BCQ_xLk8V4jZhlHYvw)
You can watch states by individual or all state using: "*", "root" , "all"