Socket
Book a DemoInstallSign in
Socket

fileup-redux

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fileup-redux

Redux adapter to fileup-core

latest
Source
npmnpm
Version
1.1.3
Version published
Maintainers
1
Created
Source

fileup-redux

Redux adapter to fileup-core

Installation

  • Append fileup reducer to application reducers:
import fileup from 'fileup-redux/lib/reducers/fileup';

export default combineReducers({
    fileup,
    //...
});
  • 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

Keywords

javascript

FAQs

Package last updated on 30 Mar 2018

Did you know?

Socket

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.

Install

Related posts