
Security News
CISA Kills Off RSS Feeds for KEVs and Cyber Alerts
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
namespace-constants
Advanced tools
Add namespace to Redux action type constants without name conflicts.
Namespacing Redux action type constant values.
npm install --save namespace-constants
import constants from 'namespace-constants';
export const {
ADD_TODO,
REMOVE_TODO,
TOGGLE_TODO
} = constants([
'ADD_TODO',
'REMOVE_TODO',
'TOGGLE_TODO'
]);
// {
// 'ADD_TODO': 'ADD_TODO',
// 'REMOVE_TODO': 'REMOVE_TODO'
// 'TOGGLE_TODO': 'TOGGLE_TODO'
// }
import constants from 'namespace-constants';
export const {
ADD_TODO,
REMOVE_TODO,
TOGGLE_TODO
} = constants('ns', [
'ADD_TODO',
'REMOVE_TODO',
'TOGGLE_TODO'
]);
// {
// 'ADD_TODO': 'ns:ADD_TODO',
// 'REMOVE_TODO': 'ns:REMOVE_TODO'
// 'TOGGLE_TODO': 'ns:TOGGLE_TODO'
// }
export const {
ADD_TODO,
REMOVE_TODO,
TOGGLE_TODO
} = constants('ns', [
'ADD_TODO',
'REMOVE_TODO',
'TOGGLE_TODO'
], { separator: '/' });
// {
// 'ADD_TODO': 'ns/ADD_TODO',
// 'REMOVE_TODO': 'ns/REMOVE_TODO'
// 'TOGGLE_TODO': 'ns/TOGGLE_TODO'
// }
export const {
ADD_TODO,
REMOVE_TODO,
TOGGLE_TODO,
SHOW_ALL,
SHOW_COMPLETED,
SHOW_ACTIVE,
FETCH,
EXPORT
} = constants('ns', [
'ADD_TODO',
'REMOVE_TODO',
'TOGGLE_TODO',
['SHOW_ALL', 'SHOW_COMPLETED', 'SHOW_ACTIVE'],
{
'FETCH': ['REQUEST', 'SUCCESS', 'FAILURE'],
'EXPORT': 'EXPORT'
}
]);
// {
// 'ADD_TODO': 'ns:ADD_TODO',
// 'REMOVE_TODO': 'ns:REMOVE_TODO',
// 'TOGGLE_TODO': 'ns:TOGGLE_TODO',
// 'SHOW_ALL': 'ns:SHOW_ALL',
// 'SHOW_COMPLETED': 'ns:SHOW_COMPLETED',
// 'SHOW_ACTIVE': 'ns:SHOW_ACTIVE',
// 'FETCH': {
// 'REQUEST': 'ns:FETCH.REQUEST',
// 'SUCCESS': 'ns:FETCH.SUCCESS',
// 'FAILURE': 'ns:FETCH.FAILURE'
// },
// 'EXPORT': 'ns:EXPORT'
// }
export const {
ADD_TODO,
REMOVE_TODO,
TOGGLE_TODO,
SHOW_ALL,
SHOW_COMPLETED,
SHOW_ACTIVE,
FETCH,
EXPORT
} = constants('ns', {
'ADD_TODO': 'ADD_TODO',
'REMOVE_TODO': 'REMOVE_TODO',
'TOGGLE_TODO': 'TOGGLE_TODO',
'SHOW_ALL': 'SHOW_ALL',
'SHOW_COMPLETED': 'SHOW_COMPLETED',
'SHOW_ACTIVE': 'SHOW_ACTIVE',
'FETCH': ['REQUEST', 'SUCCESS', 'FAILURE'],
'EXPORT': 'EXPORT'
});
// {
// 'ADD_TODO': 'ns:ADD_TODO',
// 'REMOVE_TODO': 'ns:REMOVE_TODO',
// 'TOGGLE_TODO': 'ns:TOGGLE_TODO',
// 'SHOW_ALL': 'ns:SHOW_ALL',
// 'SHOW_COMPLETED': 'ns:SHOW_COMPLETED',
// 'SHOW_ACTIVE': 'ns:SHOW_ACTIVE',
// 'FETCH': {
// 'REQUEST': 'ns:FETCH.REQUEST',
// 'SUCCESS': 'ns:FETCH.SUCCESS',
// 'FAILURE': 'ns:FETCH.FAILURE'
// },
// 'EXPORT': 'ns:EXPORT'
// }
MIT
FAQs
Add namespace to Redux action type constants without name conflicts.
The npm package namespace-constants receives a total of 227 weekly downloads. As such, namespace-constants popularity was classified as not popular.
We found that namespace-constants demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.