3.0.1 • Published 4 years ago

@k-ramel/driver-redux-form v3.0.1

Weekly downloads
18
License
MIT
Repository
github
Last release
4 years ago

@k-ramel/driver-redux-form

Redux Form driver for k-ramel

Install it

yarn add @k-ramel/driver-redux-form regeneratorRuntime

Note

You have to wrap your application with react-redux Provider and giving the k-ramel store created via createStore in order to work.

Examples

In store definition (See main documentation about description)

/* store.js */
import { createStore } from 'k-ramel'
import reduxform from '@k-ramel/driver-redux-form'

export default createStore(
  {
    /* your store description */
  },
  {
    drivers: {
      form: reduxform({ path: 'ui.form', getState: state => state.ui.form }) // default is { path: 'form' }
    },
  },
)

In a reaction (See main documentation about listeners/reactions)

/* reaction.js */

export const signin = (store, action, drivers) => {
  const { form, http } = drivers
  const signinForm = form('signin')
  const loginValues = signinForm.getFormValues()
  // check login is not empty
  if (loginValues.login && loginValues.password) {
    signinForm.setSubmitSucceeded()
  } else {
    signinForm.setSubmitFailed()
  }
}
3.0.1

4 years ago

3.0.0

4 years ago

2.1.0

5 years ago

2.0.0

5 years ago

2.0.0-alpha.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.0

6 years ago

1.0.0-alpha.0

6 years ago

0.15.1

6 years ago

0.14.0

6 years ago

0.13.2

6 years ago

0.13.1

6 years ago

0.13.0

6 years ago

0.12.1

6 years ago

0.12.0

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago