Linghao Li

Results 33 comments of Linghao Li

@sorrycc 下图这样可以: ![image](https://user-images.githubusercontent.com/1787964/54814680-3010f300-4ccb-11e9-8bfb-f0613e79e91c.png)

目前,所有通过 Mirror 来管理的 Redux state,都需要通过 `mirror.model` 来“注入”。因此也没有“全局 model”的概念。 如果你的部分数据不想通过 Mirror 管理(即不使用 actions[modelName][actionName] 来 dispatch),那么你可以定义一个标准的 redux reducer,通过 `mirror.defaults` 方法指定,然后手动调用标准的 `dispatch` 方法,也可以过在 `connect` 里传 `mapDispatchToProps` 处理。

Yes of course, just connect `mediaQuery` model's state for your ui state. For your example, here is a possible solution: ```js import mirror, { actions } from 'mirrorx' mirror.model({ name:...

You can. Try the [`mirror.hook`](https://github.com/mirrorjs/mirror/blob/master/docs/api.md#mirrorhookaction-getstate--) API, **though you should be careful to update state in hooks**.

Yes you are right, The `store` object is not explained in the API doc, because we thought it is obvious that most people are capable of figuring out what it...

可否再详细描述下问题以及重现场景?

参考下这位同学的实现哈: https://github.com/mirrorjs/mirror/issues/88#issuecomment-428879613

仔细看了代码,这么实现的确是能用的,哈。 不过确实,`render` 函数的函数签名变得太复杂了,原本 3 个参数的函数就已经属于参数过多了,再加一个无疑加重了这种印象。 `redux-persist`,照我的理解,它的 `persistReducer` 是完全可以通过 mirrorx 现有的接口(`mirrorx.deafults`)处理掉的;目前无法处理的,是它的 `persistStore` 方法,该方法要求能够访问到 store 对象。 容我再想想,怎么更好地允许三方库处理 store 对象 :)

赞 👍👍,感谢支持!

待我确认下 `@types/mirrorx` 哈