2.0.1 • Published 4 years ago
redux-popup v2.0.1
redux-popup
Redux wrapper for modals
Uses Dialog from react-toolbox
Usage
As component
import {ReduxPopup} from 'redux-popup';
class Popup extends Component {
    
    render() {
        return (
            <div>
                <h1>My popup</h1>
            </div>
        )
    }
    
}
class OtherComponentOrContainer extends Component {
    render() {
            return (
                <ReduxPopup name="test" component={Popup} popupType="storeKey"/>
            )
        }
}As function
import {createReduxPopup} from 'redux-popup';
class Popup extends Component {
    
    render() {
        return (
            <div>
                <h1>My popup</h1>
            </div>
        )
    }
    
}
export default createReduxPopup({
    name: 'test',
    modal: Dialog,
    popupType: 'storeKey',
})(Popup);Configuring everything
popupType property defines store (reducer) key
default value is 'popup'
    <ReduxPopup name="test" component={Popup} popupType="storeKey"/>to attach reducer use makePopupReducer
    import {combineReducers} from 'redux';
    import {makePopupReducer} from 'redux-popup';
    export default combineReducers({
        storeKey: makePopupReducer('storeKey'),
    });to dispatch actions use actionDecorator
    import {closeAllPopups, actionDecorator} from 'redux-popup';
    store.dispatch(actionDecorator('storeKey')(closeAllPopups());2.0.1
4 years ago
2.0.0
4 years ago
1.1.4
6 years ago
1.1.3
8 years ago
1.1.2
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.5
8 years ago
1.0.4
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago
0.2.0
8 years ago
0.1.4
9 years ago
0.1.3
9 years ago
0.1.2
9 years ago
0.1.1
9 years ago
0.1.0
9 years ago
0.0.1-alpha.0
9 years ago