@xunlei/vuex-action-debounce

1.0.1 • Public • Published

@xunlei/vuex-action-debounce

Vuex action debounce 插件,可以让相同类型及参数的action在单位时间内只有一次,从而避免重复网络请求

用法

安装

npm install @xunlei/vuex-action-debounce -S

使用

import vuexActionDebounce from @xunlei/vuex-action-debounce

const timeout = 0 // 请求完成后的缓存时间
const vuexActionDebouncePlugin = vuexActionDebounce(timeout)

const store = new Vuex.Store({
  state,
  mutations,
  plugins: [ vuexActionDebouncePlugin ]
})

注意

  • action 需要返回promise

Package Sidebar

Install

npm i @xunlei/vuex-action-debounce

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • greenfavo
  • luojianet
  • realgeoffrey
  • jqroom
  • binggg
  • bbsun
  • xunleif2e