npm promotes metadefinitions

    fileup-redux

    1.1.3 • Public • Published

    fileup-redux

    Redux adapter to fileup-core

    Installation

    1. Append fileup reducer to application reducers:
    import fileup from 'fileup-redux/lib/reducers/fileup';
     
    export default combineReducers({
        fileup,
        //...
    });
    1. Decorate you React Component with fileup:
    import fileup from 'fileup-redux';
     
    class MyFiles extends React.Component {
     
        render() {
            return (
                <div>
                    {this.props.files.map(file => (
                        <div key={file.uid}>
                            {file.name}
                        </div>
                    ))}
                    <button onClick={() => this.props.uploader.browse()}>Browse</button>
                </div>
            );
        }
     
    }
     
    export default fileup({
        backendUrl: '/file/upload/',
    })(MyFiles);

    HOC configuration

    • id Unique identifier in redux store
    • backendUrl Backend url to file upload
    • uploader FileUp configuration

    Install

    npm i fileup-redux

    DownloadsWeekly Downloads

    5

    Version

    1.1.3

    License

    MIT

    Unpacked Size

    22.7 kB

    Total Files

    11

    Last publish

    Collaborators

    • affka