create-redux-actions-typesdeprecated

Create redux action types with normal javascript object.

Usage no npm install needed!

<script type="module">
  import createReduxActionsTypes from 'https://cdn.skypack.dev/create-redux-actions-types';
</script>

README

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"