[PR #31159] perf(web): use getState() for Zustand setters in callbacks #33115

Closed
opened 2026-02-21 20:52:41 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/31159

State: closed
Merged: No


Summary

  • Replace useStore(s => s.setXxx) subscriptions with store.getState().setXxx() in callbacks
  • Refactor tests to use real Zustand stores with global mock auto-reset
  • Add Zustand store testing best practices to frontend-testing skill

Test plan

  • All refactored tests pass (128 tests)
  • Lint checks pass

Fixes #31158

**Original Pull Request:** https://github.com/langgenius/dify/pull/31159 **State:** closed **Merged:** No --- ## Summary - Replace `useStore(s => s.setXxx)` subscriptions with `store.getState().setXxx()` in callbacks - Refactor tests to use real Zustand stores with global mock auto-reset - Add Zustand store testing best practices to frontend-testing skill ## Test plan - [x] All refactored tests pass (128 tests) - [x] Lint checks pass Fixes #31158
yindo added the pull-request label 2026-02-21 20:52:41 -05:00
yindo closed this issue 2026-02-21 20:52:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33115