Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

driver / form / helpers #284

Open
guillaumecrespel opened this issue Jan 14, 2019 · 3 comments
Open

driver / form / helpers #284

guillaumecrespel opened this issue Jan 14, 2019 · 3 comments
Labels
feature help wanted Extra attention is needed

Comments

@guillaumecrespel
Copy link
Member

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

  • ({ payload }) => payload['@@form-name'] === 'form1'
  • const values = action.payload['@@form-fileds'].map(f => action.payload[f])
@fabienjuif
Copy link
Member

fabienjuif commented Jan 14, 2019

import { matchForm } from '@k-ramel/driver-form'
 
when(matchForm(<name>))(reaction)
const reaction = (action, store, { form }) => {
  const values = form.getUpdatedValues(action)
}
const reaction = (action, store, { form }) => {
  const fields = form.getUpdatedFieldNames(action)
}

@fabienjuif fabienjuif self-assigned this Jan 14, 2019
@fabienjuif fabienjuif added this to the 1.3.0 milestone Jan 14, 2019
@fabienjuif
Copy link
Member

waiting for #283

@fabienjuif
Copy link
Member

fabienjuif commented Jan 14, 2019

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

  • matcher should pass action (this is already the case) + store (this is already the case) + drivers (this is NOT the case)
  • then I can write the helper in the driver
when((action, store, drivers) => drivers.form.match('myForm'))(reaction)

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

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

@fabienjuif fabienjuif removed this from the 1.3.0 milestone Jan 14, 2019
@fabienjuif fabienjuif removed their assignment Mar 25, 2019
@fabienjuif fabienjuif added the help wanted Extra attention is needed label Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants