
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@malfaitrobin/redux-namespaced-types
Advanced tools
namespacedTypes
Handle namespaced
namespace/type/subtype
actions, this allows you to cleanly organise some related tasks. It comes with anamespace
utility to function to prepare your actions.
With yarn
:
yarn install @malfaitrobin/redux-namespaced-types
With npm
:
npm install --save @malfaitrobin/redux-namespaced-types
import { createReducerCreator } from "@malfaitrobin/redux";
import {
namespacedTypesMiddleware,
namespace
} from "@malfaitrobin/redux-namespaced-types";
const createReducer = createReducerCreator(
namespacedTypesMiddleware /* ...other middleware */
);
const defaultState = {
value: 0
};
const reducer = createReducer(
{
FETCH_FOO: {
// This will handle an action with { type: 'FETCH_FOO/START' } is dispatched.
START: (state, action) => {
return state;
},
// This will handle an action with { type: 'FETCH_FOO/SUCCESS' } is dispatched.
SUCCESS: (state, action) => {
return state;
},
// This will handle an action with { type: 'FETCH_FOO/FAILED' } is dispatched.
FAILED: (state, action) => {
return state;
}
}
},
defaultState
);
// Example action usage:
const FOO = "FOO";
function fooStart() {
return createAction(namespace(FOO, "START"));
}
function fooSuccess(response) {
return createAction(namespace(FOO, "SUCCESS"), response);
}
function fooFailed(error) {
return createAction(namespace(FOO, "FAILED"), error);
}
function fetchFoo() {
return dispatch => {
dispatch(fooStart());
return fetch("https://api.example.com/")
.then(response => response.json())
.then(response => dispatch(fooSuccess(response)))
.catch(error => dispatch(fooFailed(error)));
};
}
FAQs
Redux utilities
The npm package @malfaitrobin/redux-namespaced-types receives a total of 0 weekly downloads. As such, @malfaitrobin/redux-namespaced-types popularity was classified as not popular.
We found that @malfaitrobin/redux-namespaced-types 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.