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

如何动态删除指定的缓存? #31

Open
ado5 opened this issue Aug 26, 2022 · 1 comment
Open

如何动态删除指定的缓存? #31

ado5 opened this issue Aug 26, 2022 · 1 comment
Labels
question Further information is requested

Comments

@ado5
Copy link

ado5 commented Aug 26, 2022

if (process.env.NODE_ENV !== 'production') {
middleware.push(
createLogger({
collapsed: true,
diff: true,
duration: true,
logErrors: true,
}),
)
}

store.init({
compose: 'redux-devtools',
middleware,
persist: [
{
version: 1,
key: home-${process.env.NODE_ENV},
maxAge: 60 * 60 * 1000,
engine: taroStorage,
models: [homeModel],
},
{
version: 1,
key: cate-${process.env.NODE_ENV},
maxAge: 60 * 60 * 1000,
engine: taroStorage,
models: [cateModel],
},
],
})

我想在homeModel中监控到有新数据时, 动态更新 home-${process.env.NODE_ENV} 这个Key的缓存, 请问怎么样在 homeModel 中实现?

@geekact
Copy link
Member

geekact commented Aug 26, 2022

homeModel如果有操作更新,缓存那边也是自动更新的。
所以你说的动态更新和我想的不一样吗,能否具体描述一下?

@geekact geekact added the question Further information is requested label Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants