feltnerm / redux-fine-uploader

:arrow_heading_up: :pouch: Enables FineUploader to store its all of its state with Redux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

redux-fine-uploader

🔬 Experimental! 🔬

Experimental! Build Status

Still a ton of work to do here: I'm not happy w/ the public API, all of Fine Uploader's callbacks and their parameters must be defined and handled, and much more. Treat this as a public proof of concept.

Enables Fine Uploader to store its state with Redux.

  • reducer namespaces allow sharing or hiding of data in the store.
  • wraps Fine Uploader's public callbacks so that "actions" are dispatched with callback data as the action payload.

State

Ends up looking like this:

[uploader_name]: {
    files: {
        [fineUploaderFileId]: {
            [data]
        }
    }
}

Example

Minimal example in ./example. Run with npm run example from root, or npm run build from the example directory.

Quick Setup

Reducer
const redux = require('redux')

const reduxFineUploader = require('../../..')
const { reducer } = reduxFineUploader

const makeReducer = () => reducer()
const makeStore = () => redux.createStore(redux.combineReducers({
    uploader: makeReducer()
}))

module.exports = makeStore

Todo

  • Patch all of Fine Uploader's callbacks so they use dispatch.
  • Store Fine Uploader callback parameters/data in Redux store

About

:arrow_heading_up: :pouch: Enables FineUploader to store its all of its state with Redux


Languages

Language:JavaScript 100.0%