Guest User

Untitled

a guest
Jun 12th, 2025
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. store.setState = ((original) => function(patch, ...args) {
  2. const current = store.getState().staging;
  3. if ('staging' in patch) {
  4. if (JSON.stringify(current) === JSON.stringify(patch.staging)) {
  5. console.log("[patched store.setState] skipped", patch.staging);
  6. return;
  7. }
  8. }
  9. console.log("[patched store.setState] setting", patch);
  10. return original.call(this, patch, ...args);
  11. })(store.setState);
  12.  
Advertisement
Add Comment
Please, Sign In to add comment