spacename

0.1.0 • Public • Published

spacename

Namespace your type constants.

license version downloads

Usage

Install:

npm install --save spacename

Define:

import define from `spacename`;
 
const ns = define('auth');
 
export const LOGGED_IN = ns('LOGGED_IN'); // auth/LOGGED_IN
export const LOGGED_OUT = ns('LOGGED_OUT'); // auth/LOGGED_OUT
 

Works great with babel-plugin-filenamespace:

// .babelrc
{
  "plugins": [
    [
      "filenamespace",
      {
        "root": "src",
      }
    ]
  ]
}
 
// src/action/auth.js
import define from `spacename`;
 
const ns = define(__filenamespace);
 
export const LOGGED_IN = ns('LOGGED_IN'); // action/auth/LOGGED_IN
export const LOGGED_OUT = ns('LOGGED_OUT'); // action/auth/LOGGED_OUT
 

Readme

Keywords

none

Package Sidebar

Install

npm i spacename

Weekly Downloads

2

Version

0.1.0

License

CC0-1.0

Last publish

Collaborators

  • nealgranger