lundi 24 octobre 2016

Control the order of ember promise resolution?

I've been following the tutorial, using ember 2.9.1, node 6.9.1, chrome 53.0.2785.143 and OS/X 10.11.6.

When I create the component described here: http://ift.tt/2eFbMgH

I end up with a race condition. If I enter the character p into the input and very rapidly hit backspace, I end up with the models filtered by the character p but no input in the text field.

Some console logging suggests this is happening because the second promise (which returns all the models, since the input is empty) is resolving first, and the first promise (returning the filtered models) resolves second.

Is there anything that can be done about this?




Aucun commentaire:

Enregistrer un commentaire