0.0.1 • Published 5 years ago
create-redux-actions-types v0.0.1
Create Redux Action Types
Create redux action types with normal javascript object.
Install
npm install --save create-redux-action-types
or
yarn add create-redux-action-types
Usage
# file:actionTypes.ts
import createReduxActionTypes from "create-redux-action-types"
export default createReduxActionTypes(
{
auth: {
login: "",
logout: "",
},
some: {
foo: {
bar: ""
}
}
},
"-", // delimiter, default "/"
"app" // namespace, default undefined
);
# file:some.ts
import actionTypes from "./actionTypes"
actionTypes.auth.login // "app-auth-login"
actionTypes.some.foo.bar // "app-some-foo-bar"
0.0.1
5 years ago