Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

给 render 函数提供另一个 callback #100

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

limitLiu
Copy link

想比较优雅地集成 redux 的 persist 插件, 以及 persist 的 immutable 插件, 所以就搞了这么个东西.
虽然函数签名变得有点丑了 // 但是能用.
也写了个例子. // 话说, 请随意拒绝吧.

@llh911001
Copy link
Member

仔细看了代码,这么实现的确是能用的,哈。

不过确实,render 函数的函数签名变得太复杂了,原本 3 个参数的函数就已经属于参数过多了,再加一个无疑加重了这种印象。

redux-persist,照我的理解,它的 persistReducer 是完全可以通过 mirrorx 现有的接口(mirrorx.deafults)处理掉的;目前无法处理的,是它的 persistStore 方法,该方法要求能够访问到 store 对象。

容我再想想,怎么更好地允许三方库处理 store 对象 :)

@limitLiu
Copy link
Author

仔细看了代码,这么实现的确是能用的,哈。

不过确实,render 函数的函数签名变得太复杂了,原本 3 个参数的函数就已经属于参数过多了,再加一个无疑加重了这种印象。

redux-persist,照我的理解,它的 persistReducer 是完全可以通过 mirrorx 现有的接口(mirrorx.deafults)处理掉的;目前无法处理的,是它的 persistStore 方法,该方法要求能够访问到 store 对象。

容我再想想,怎么更好地允许三方库处理 store 对象 :)

你们比较严谨考虑问题, 赞一个.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants