forked from petkaantonov/bluebird
-
Notifications
You must be signed in to change notification settings - Fork 0
Error: circular promise resolution chain
benjamingr edited this page Feb 6, 2014
·
3 revisions
Error: circular promise resolution chain
This usually happens when you have a promise that resolves or rejects with itself.
For example: var p = Promise.delay(100).then(function(){ return p});
.
In this case, the promise resolves with itself which was is not intended.
This also happens when implementing live-updating models with a .then
method that indicates when the model is "ready". A promise is a process, it starts and it ends.
Promises do not aim to solve such live updating problems directly. One option would be to use an intermediate promise - for example a .loaded
property on the model that fulfills with nothing.
resolving it with itself tells it "it is done when it is done"