poa-dapps-voting/src/stores/CommonStore.js

43 lines
917 B
JavaScript
Raw Normal View History

2018-07-12 05:40:39 -07:00
import { observable, action } from 'mobx'
class CommonStore {
2018-07-12 05:40:39 -07:00
@observable loading
@observable loadingNetworkBranch
2018-07-12 05:40:39 -07:00
@observable rootPath
@observable isActiveFilter
@observable isToFinalizeFilter
@observable searchTerm
@observable loadMoreLimit
2018-07-12 05:40:39 -07:00
constructor() {
this.loading = false
this.loadingNetworkBranch = null
2018-07-12 05:40:39 -07:00
this.isActiveFilter = false
this.isToFinalizeFilter = false
this.rootPath = '/poa-dapps-voting'
this.loadMoreLimit = 10
}
2018-07-12 05:40:39 -07:00
@action('show loading')
showLoading(loadingNetworkBranch) {
2018-07-12 05:40:39 -07:00
this.loading = true
this.loadingNetworkBranch = loadingNetworkBranch
2018-07-12 05:40:39 -07:00
}
2018-07-12 05:40:39 -07:00
@action('hide loading')
hideLoading() {
this.loading = false
this.loadingNetworkBranch = null
2018-07-12 05:40:39 -07:00
}
2017-12-25 07:47:33 -08:00
2018-07-12 05:40:39 -07:00
@action('set search term')
setSearchTerm = _val => {
this.searchTerm = _val
}
}
2018-07-12 05:40:39 -07:00
const commonStore = new CommonStore()
2018-07-12 05:40:39 -07:00
export default commonStore
export { CommonStore }