Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
redux-modal
Advanced tools
redux-modal
connect your modal to the redux store, and let you control your modal by simply dispatching actions.
It works with any react based modal component.
npm i --save redux-modal
Connect a modal component to redux store.
config
(Object)
name
(String)(Require) The modal name.resolve
(Function) Things you want to resolve before show your modal, if return a promise, the modal will show after the promise resolved.destroyOnHide
(Bool) Whether destroy the modal state and umount the modal after hide, default is true.getModalState
(Function) A function that takes the entire Redux state and returns the state slice which corresponds to where the redux-modal reducer was mounted. Defaults to assuming that the reducer is mounted under the 'modal' key.A React component class that injects modal state, handleHide
and handleDestroy
action creator into your modal component.
export default connectModal({ name: 'myModal' })(MyModal)
It will pass the modal state and a handleHide
and handleDestroy
action creator as props to your modal component.
If you mounted your modal reducer at some other location such as modals
instead of modal
use the getModalState
config
export default connectModal({ name: 'myModal', getModalState: (state) => state.modals })(MyModal)
The modal reducer. Should be given to mounted to your Redux state at modal
.
import { combineReducers } from 'redux'
import { reducer as modal } from 'redux-modal'
export default combineReducers({
...yourOtherReducers,
modal
})
The show modal action creator.
name
(String) The name of modal to show.props
(Object) Props pass to your modal.The hide modal action creator.
name
(String) The name of modal to hide.MIT
FAQs
Redux based modal
We found that redux-modal 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.