Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4870

Understanding what to expect from ember-changeset

$
0
0

Hi - I have started using ember-changeset with my app and it isn’t working the way I expected. I am wondering if there is a way to harness ember-changeset to do what I want.

Here is what I would expect from a changeset: changesets

Underlying assumptions:

  • Anything that originates from a user in any form is suspect.
  • Each source of user-supplied data needs to be validated.
  • Each source needs its own changeset and its own error list.
  • Once something is validated, it gets pushed into state.
  • The rest of the system is wired to only pay attention to validated state.
  • System state changes get delivered to all the changesets attached to it, flushing pending inputs.
  • When that happens, those fields are no longer “dirty”.
  • Consequently, the error list showing for a source should accurately reflect the error state of the mix of “clean” and “dirty” data sitting in that source’s changelist.

Instead, I find that when the state changes, the data in the changeset updates accordingly, but the error list retains all of the errors in the data that was in the changeset before the update. No errors are removed and no fields are revalidated.

Is this expected behavior? Is there a tidy way to get the behavior I expect? To get this behavior, should I be using ember-changeset at all or is there something much simpler I can do?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4870

Trending Articles