Murderlon ab771cbe1c Release пре 3 година
..
src 6b7ad5e7c7 Stricter linter (#3095) пре 3 година
types 5630f7dc07 tools: enable linter for TypeScript (#2997) пре 3 година
LICENSE 90c0b626c1 Move `ReduxStore` to the `@uppy/store-redux` package. пре 6 година
README.md c48064ba56 doc: lint JS code snippets (#2954) пре 3 година
package.json ab771cbe1c Release пре 3 година

README.md

@uppy/store-redux

CI status for Uppy tests CI status for Companion tests CI status for browser tests

The ReduxStore stores Uppy state on a key in an existing Redux store. The ReduxStore dispatches uppy/STATE_UPDATE actions to update state. When the state in Redux changes, it notifies Uppy. This way, you get most of the benefits of Redux, including support for the Redux Devtools and time traveling!

Uppy is being developed by the folks at Transloadit, a versatile file encoding service.

Example

import { combineReducers, createStore } from 'redux'
import Uppy from '@uppy/core'
import ReduxStore from '@uppy/store-redux'
import reducers from './reducers'

const reducer = combineReducers({
  ...reducers,
  uppy: ReduxStore.reducer,
})

const store = createStore(reducer)

const uppy = new Uppy({
  store: ReduxStore({
    store,
  }),
})

Installation

$ npm install @uppy/store-redux

We recommend installing from npm and then using a module bundler such as Webpack, Browserify or Rollup.js.

Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case Uppy will attach itself to the global window.Uppy object. See the main Uppy documentation for instructions.

Documentation

Documentation for this plugin can be found on the Uppy website.

License

The MIT License.