Commit 7876801
committed
feat: add Zustand store for selector-based config subscriptions
Adds Zustand-based config store to enable granular re-renders when
config values change. Components can now use useConfigSelector() to
subscribe to specific config properties instead of re-rendering on
any config change.
- Add zustand as dev and peer dependency
- Create configStore.ts with useConfigSelector/useConfigValue hooks
- Integrate Zustand store into ConfigProvider
- Add legacy bridge (updateLegacyStore) for setConfig() compatibility
- Support multiple WormholeConnect instances with isolated state
- Add comprehensive tests for store and context integration1 parent 376c4f4 commit 7876801
7 files changed
Lines changed: 1108 additions & 40 deletions
File tree
- src
- config
- contexts
- store
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| |||
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
203 | | - | |
| 204 | + | |
| 205 | + | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
275 | 281 | | |
276 | 282 | | |
277 | 283 | | |
| |||
0 commit comments