
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.
redux-rubik-reducer
Advanced tools
An npm package to get the redux compatible reducer function and action creator for Rubik's cube state handling.
npm install --save redux-rubik-reducer
//Import methods and constants
import {
reducer,
createAction,
initialState,
ActionType
} from "redux-rubik-reducer";
//Initialize state
let state = initialState;
//Create action passing ActionType as parameter
let action = createAction(ActionType.ROTATE_RIGHT);
//Get new state
state = reducer(state, action);
//Import methods and constants
import {
reducer,
createAction,
actionHandlers,
initialState,
ActionType,
CellType
} from "redux-rubik-reducer";
//Create custom CellType
CellType.Custom = "YOUR_CUSTOM_CELL_TYPE_CONSTANT";
//Create custom state
let customState = [
[
[CellType.BLUE, CellType.RED, CellType.GREEN],
[CellType.YELLOW, CellType.RED, CellType.ORANGE],
[CellType.BLUE, CellType.BLUE, CellType.ORANGE]
],
[
[CellType.YELLOW, CellType.WHITE, CellType.WHITE],
[CellType.RED, CellType.YELLOW, CellType.GREEN],
[CellType.WHITE, CellType.BLUE, CellType.ORANGE]
],
[
[CellType.RED, CellType.ORANGE, CellType.BLUE],
[CellType.WHITE, CellType.ORANGE, CellType.YELLOW],
[CellType.WHITE, CellType.WHITE, CellType.GREEN]
],
[
[CellType.GREEN, CellType.ORANGE, CellType.YELLOW],
[CellType.BLUE, CellType.WHITE, CellType.GREEN],
[CellType.WHITE, CellType.YELLOW, CellType.YELLOW]
],
[
[CellType.RED, CellType.BLUE, CellType.RED],
[CellType.RED, CellType.GREEN, CellType.WHITE],
[CellType.ORANGE, CellType.GREEN, CellType.GREEN]
],
[
[CellType.BLUE, CellType.GREEN, CellType.ORANGE],
[CellType.YELLOW, CellType.BLUE, CellType.RED],
[CellType.YELLOW, CellType.ORANGE, CellType.RED]
]
];
//Add custom ActionType
ActionType.CUSTOM_ACTION = "YOUR_CUSTOM_ACTION_TYPE_CONSTANT";
//Create custom action
let action = createAction(ActionType.CUSTOM_ACTION);
//Use actionHandlers
let changedCustomState = actionHandlers.rotateRight(customState);
//Create custom action handlers
/**
* @param {string[][][]} state
* @returns {string[][][]}
*/
actionHandlers.customHandler = state => {
/*Your code*/
};
//Use it
actionHandlers.customHandler(changedCustomState);
//Customize reducer function
/**
* @param {string[][][]} state
* @param {Action} action
* @returns {string[][][]}
*/
const customReducer = (state, action) => {
//Handle your custom action(s) first
switch (action.type) {
case ActionType.CUSTOM_ACTION:
return actionHandlers.customHandler(state);
//If not custom action handle it with reducer function
default:
return reducer(state, action);
}
};
Any contribution you make is greatly appreciated. :)
This project is licensed under the terms of the MIT license.
FAQs
redux-rubik-reducer
We found that redux-rubik-reducer 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.