Skip to content

Instantly share code, notes, and snippets.

@hyzhak
Created November 14, 2018 10:40
Show Gist options
  • Save hyzhak/2cd0d90b7480a76b6fd18a4244fec105 to your computer and use it in GitHub Desktop.
Save hyzhak/2cd0d90b7480a76b6fd18a4244fec105 to your computer and use it in GitHub Desktop.
get current app redux namespace
import packageJSON from '../../package'
/**
* get current app namespace
*/
module.exports = function getReduxNamespace () {
return packageJSON.name
}
@hyzhak
Copy link
Author

hyzhak commented Nov 14, 2018

Usage

const namespace = require('../utils/get-namespace')()

//
// actions
//

// append new items to already existing list
export const APPEND_EVIDENCES_REQUEST = `${namespace}/EVIDENCES.APPEND:REQUEST`
export const APPEND_EVIDENCES_RECEIVE = `${namespace}/EVIDENCES.APPEND:RECEIVE`
export const APPEND_EVIDENCES_ERROR = `${namespace}/EVIDENCES.APPEND:ERROR`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment