State types
Tiny and easy creating unique types in popular state-management solutions
Usage
You can simple generate types object in one function:
const testTypes = // Will return 'foo': '@@test/foo' 'bar': '@@test/bar'
Vuex mutations, actions, etc.
You can use it in vuex
:
const testMutations = state: false mutations: testMutationsfoo: state = true testMutationsbar: state = false ... // Import it where you want and use this$store
Redux actions types
You can use it in redux
:
const actionsTypes = const actionsCreators = actionsTypesfoo: type: actionsTypesfoo actionsTypesbar: type: actionsTypesbar export { } ... // Import it where you want and use
Other cases
You can use it everywhere because it solution hasn't any semantic and code bindings to libraries and frameworks.