
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-hook-middleware
Advanced tools
A Redux middleware to provide easy hooks on pre/post dispatch.
$ npm i redux-hook-middleware -S
import { createStore, applyMiddleware } from 'redux'
import hookMiddleware, { registerPrehook } from 'redux-hook-middleware'
// redux setup
const initialState = { /* initial state */ }
const reducer = (state = initialState, action) => { /* reducer function logics */ return state }
const middlewares = [hookMiddleware]
const store = createStore(reducer, initialState, applyMiddleware(...middlewares))
// middleware logic
registerPrehook('HOOKING_ACTION_TYPE', (store, action) => {
console.log('prehooked!')
// do anything inside callback
// you can also dispatch other actions
store.dispatch({ type: 'SOME_ACTION_TYPE' })
})
// how does it works
store.dispatch({ type: 'HOOKING_ACTION_TYPE' }) // 'prehooked!'
registerPrehook(type<string>, hook<function>)<symbol>
Register a hook for former middleware chain and return uniq id for the hook.
registerPosthook(type<string>, hook<function>)<symbol>
Register a hook for later middleware chain and return uniq id for the hook.
registerPrehooks(hookObject<object>)<object>
Register hooks for former middleware chain and return uniq id for the hook. Pass an action type as key and a callback or an array of callbacks as value.
registerPosthooks(hookObject<object>)<onject>
Register hooks for later middleware chain and return uniq id for the hook. Pass an action type as key and a callback or an array of callbacks as value.
unregisterHook(id<symbol>)<void>
Unregister the hook with hook id.
clearHooks()<void>
Unregister all the hooks registered.
$ git clone https://github.com/kamataryo/redux-hook-middleware.git
$ cd redux-hook-middleware
$ npm test
FAQs
A Redux middleware to provide easy hooks on pre/post dispatch.
The npm package redux-hook-middleware receives a total of 30 weekly downloads. As such, redux-hook-middleware popularity was classified as not popular.
We found that redux-hook-middleware demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.