Skip to content

Commit

Permalink
runloop aware
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer committed Feb 26, 2021
1 parent 64755f5 commit 63b93c2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/dummy/app/components/changeset-form.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Component from '@ember/component';
import { later } from '@ember/runloop';
import { action, get } from '@ember/object';
import { tracked } from '@glimmer/tracking';
import { Changeset } from 'ember-changeset';
Expand All @@ -9,7 +10,16 @@ let dummyValidations = {
return !!value;
},
email(value) {
return new Promise((resolve) => setTimeout(resolve, 400, value && value.includes('@')));
let ok = value && value.includes('@');
return new Promise((resolve) =>
later(
this,
() => {
resolve(ok);
},
400
)
);
},
},
};
Expand Down

0 comments on commit 63b93c2

Please sign in to comment.