unirakun / k-ramel

State manager for your components apps, the safe and easy way
MIT License
21 stars 5 forks source link

driver / form / helpers #284

Open guillaumecrespel opened 5 years ago

guillaumecrespel commented 5 years ago

add helpers to not rewrite the key (default is @@form-) :

fabienjuif commented 5 years ago
  1. 
    import { matchForm } from '@k-ramel/driver-form'

when(matchForm())(reaction)


2.
```js
const reaction = (action, store, { form }) => {
  const values = form.getUpdatedValues(action)
}
const reaction = (action, store, { form }) => {
  const fields = form.getUpdatedFieldNames(action)
}
fabienjuif commented 5 years ago

waiting for #283

fabienjuif commented 5 years ago

I can't write 1. without using driver parameter to retrieve key.

I don't know if this is worth because write now we are doing:

when(/@@form\/.*/, ({ payload }) => payload['@@form-name'] === 'myForm')(reaction)