muchobien / flipper-plugin-react-native-mmkv

Plugin to control react-native-mmkv from Flipper
https://github.com/muchobien/flipper-plugin-react-native-mmkv
52 stars 3 forks source link

Able to track underlying database without connecting via JS? #1

Open henrymoulton opened 2 years ago

henrymoulton commented 2 years ago

https://github.com/muchobien/flipper-plugin-react-native-mmkv/blob/main/packages/react-native-mmkv-flipper-plugin/index.ts#L29

My understanding is that it would be better to connect to the MMKV instance directly, perhaps using the Databases approach the Flipper documentation highlights, it might be more performant. https://fbflipper.com/docs/setup/plugins/databases/

henrymoulton commented 2 years ago

Assume this is why @mrousavy asked https://twitter.com/mrousavy/status/1485336871576215552

but maybe there's another reason.

KROSF commented 2 years ago

thanks @henrymoulton, but for now i will add support for several instances and wait for databases to be available for ios

mrousavy commented 2 years ago

I would actually recommend implementing the Flipper plugin on the JS Side, like @KROSF has already done. That's because the on value changed listeners are set up on the JS Side, and not on native.

So to have the MMKV instance(s) update in realtime in the Flipper Plugin View, we need to listen for value changes.

KROSF commented 2 years ago

@henrymoulton now support multiple instances