
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
redux-action-type-factory
Advanced tools
Simple tool to create redux action type list with minimal typing, but fully autocomplete support
Simple tool to create redux action type list with minimal coding, but fully autocomplete/intellisense support
npm i redux-action-type-factory
or
yarn add redux-action-type-factory
This relies on typescript
for intellisense to run.
actionTypesFactory
actionTypesFactory
accepts first argument as the prefix, if this is empty string then there will be no prefix, the remaining arguments will be the action types.
Each defined actionType has five members, with default
is the action type itself, four others will append a suffix accordingly:
default
: ${ACTION}
begin
: ${ACTION}_BEGIN
succeeded
: ${ACTION}_SUCCEEDED
failed
: ${ACTION}_FAILED
cancelled
: ${ACTION}_CANCELLED
Use them as following:
import { actionTypesFactory } from "redux-action-type-factory";
let actionType = actionTypesFactory("todo", "INCREMENT", "DECREMENT");
actionType.INCREMENT.default; // 'todo/INCREMENT'
actionType.INCREMENT.begin; // 'todo/INCREMENT_BEGIN'
actionType.INCREMENT.succeeded; // 'todo/INCREMENT_SUCCEEDED'
actionType.INCREMENT.failed; // 'todo/INCREMENT_FAILED'
actionType.INCREMENT.cancelled; // 'todo/INCREMENT_CANCELLED'
actionType.DECREMENT.default; // 'todo/DECREMENT'
actionType.DECREMENT.begin; // 'todo/DECREMENT_BEGIN'
actionType.DECREMENT.succeeded; // 'todo/DECREMENT_SUCCEEDED'
actionType.DECREMENT.failed; // 'todo/DECREMENT_FAILED'
actionType.DECREMENT.cancelled; // 'todo/DECREMENT_CANCELLED'
// or
let actionType = actionTypesFactory("", "END");
actionType.END.default; // 'END'
actionType.END.begin; // 'END_BEGIN'
actionType.END.succeeded; // 'END_SUCCEEDED'
actionType.END.failed; // 'END_FAILED'
actionType.END.cancelled; // 'END_CANCELLED'
dictionaryFactory
dictionaryFactory
accepts a list of string argument, return an object with the according key-value pair.import { dictionaryFactory } from "redux-action-type-factory";
let platforms = dictionaryFactory("android", "ios", "web", "desktop");
platforms.android; // 'android'
platforms.ios; // 'ios'
platforms.web; // 'web'
platforms.desktop; // 'desktop'
And this is fully supported by VS Code intellisense!
FAQs
Simple tool to create redux action type list with minimal typing, but fully autocomplete support
The npm package redux-action-type-factory receives a total of 0 weekly downloads. As such, redux-action-type-factory popularity was classified as not popular.
We found that redux-action-type-factory 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.