Code Monkey home page Code Monkey logo

Comments (14)

cllgeek avatar cllgeek commented on May 18, 2024 9

mark

from blog.

ascoders avatar ascoders commented on May 18, 2024 3

写了一篇 Mobx **的实现细节,希望能对此进行补充:ascoders/blog#16

至于 vue 既视感,要看未来浏览器对其语法支持的程度,目前 magic 逻辑太多,大型项目可能不便于维护。

from blog.

flyingzl avatar flyingzl commented on May 18, 2024 1

试用了一下,Vue即视感。其实既然这样,我完全可以考虑用Vue的,现在2.0性能也蛮不错的感觉

from blog.

jzlxiaohei avatar jzlxiaohei commented on May 18, 2024

简单的用用,觉得真是无比清晰,基本把store的处理,简化为对model的处理。这种情况下,测试的编写也变的异常简单。

比较纠结的就是store的组织。redux就是单store,一棵state树。用mobx,很自然的有多个model,这些model要不要最后合成一个store,然后通过最上层的组件注入,还是每个组件拥有自己的domain store,app级的store再通过上层传入。

其实写redux也有类似的困惑,比如<UserList /> ,本身就与一个User数组对应,我直接扔进去,复用性是最好的,但是用redux,要通过最上层的store传下来。

现在能想到的就是,写个高阶函数,hoc(components,store)返回绑定好了的 ,这个store根据业务场景,看是否需要多个组件公用。react-router里使用这个wrapper

楼主有使用mobx写点稍大项目的经验吗,期待经验分享

from blog.

daiyunchao avatar daiyunchao commented on May 18, 2024

热更新是支持的

from blog.

ian4hu avatar ian4hu commented on May 18, 2024

react想要支持IE8也需要自己完全编译react和redux相关代码,无法利用公共CDN里面的预编译的js

from blog.

daiyunchao avatar daiyunchao commented on May 18, 2024

react 要支持IE8 有一个库的

from blog.

dwqs avatar dwqs commented on May 18, 2024

可以拿 Excel 表格做个比喻,Observable state 是单元格,Derivations 是计算公式,单元格的修改会触发公司的重新计算

这是公司 --> 公式

from blog.

william-xue avatar william-xue commented on May 18, 2024

可以学习一下

from blog.

jackple avatar jackple commented on May 18, 2024

请问, 在用inject的前提下, 有react-hot-loader热更新store的解决方案吗?

from blog.

jackple avatar jackple commented on May 18, 2024

@daiyunchao 请问你是怎么解决store热更新的

from blog.

hfuuss avatar hfuuss commented on May 18, 2024

期待在忙完umi的空余时间写一下 mbox最佳实践

from blog.

nelhu avatar nelhu commented on May 18, 2024

期待下一篇关于mobx的最佳实践

from blog.

JunlinZhu-Tommy avatar JunlinZhu-Tommy commented on May 18, 2024

同样期待能有一篇最佳实践。

from blog.

Related Issues (20)

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.