Git Product home page Git Product logo

Comments (4)

nanxiaobei avatar nanxiaobei commented on May 18, 2024

要实现得深层遍历 proxy,目前不考虑这样的方式。

https://zhuanlan.zhihu.com/p/468417292 "6. resso 的使用方式" 中有解释

本文中情形可以这么写,保证最后有一次重新赋值就行:

store.count.a.b.c += 1;
store.count = { ...store.count };

from resso.

huzw1995 avatar huzw1995 commented on May 18, 2024

嗯,但是我这个demo,proxy就算只监听一层应该还是能监听到数据变化的,我看了你的源码,这个demo没有触发重渲染应该是在后续的useState的setValue上面。我是挺喜欢你这样的极简设计的,代码量也很少,值得学习,但是用起来感觉还是有限制的,有空我fork下自己研究一下吧

from resso.

nanxiaobei avatar nanxiaobei commented on May 18, 2024

监听一层不会的,无论是 MobX 还是 valtio,都需要深层递归去监听。

from resso.

huzw1995 avatar huzw1995 commented on May 18, 2024

image
我刚又琢磨了一下,好像的确是不会进到这个if里面,是需要深层监听的。

from resso.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.