cerebral-legacy / cerebral-module-forms

Form handling for Cerebral
http://cerebral-website.herokuapp.com/documentation/cerebral-module-forms
MIT License
12 stars 5 forks source link

feat(dependents): change API to dependsOn with full paths #36

Closed christianalfoni closed 8 years ago

christianalfoni commented 8 years ago

BREAKING CHANGE:

The dependents API is a good concept, but API is quite confusing. With this change we will rather:

// PATH: app.form
{
  fieldA: {
    value: '',
    dependsOn: 'app.form.fieldB'
  },
  fieldB: {
    value: ''
  }
}

Or you can use an array to depend on multiple fields. This allows you to depend on nested, parent or even cross forms.

edgesoft commented 8 years ago

@christianalfoni Looks good