Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

publicAPI doesn't have fulfill method #2

Closed
jobelenus opened this issue Sep 29, 2011 · 2 comments
Closed

publicAPI doesn't have fulfill method #2

jobelenus opened this issue Sep 29, 2011 · 2 comments

Comments

@jobelenus
Copy link

Which wouldn't be such a bad thing if I wasn't also looking for deferred to work (which I am going after next)...

I would have expected:

        publicAPI.fulfill = function(val) {
    fulfill.call(publicAPI,val);
        };

To do the trick, however, the internal queue is always at 1 in this example:

var p = Handlebar.Promise();
p
.then(function(P) {
this.fulfill('foo'); //took me a second to realize this is the API and P is generally an object just for holding the value...
})
.then(function(P) {
console.log(P.value);
})

Unsure what I am missing, as the internal fulfill function is in use and working... just can't figure out how to expose it properly.

@jobelenus
Copy link
Author

OK, this feels like I'm cheating, but I think it is correct:

jobelenus@9555b59

It works for that small example..

@jobelenus jobelenus reopened this Sep 29, 2011
@jobelenus
Copy link
Author

Also, a solution for deferred:
jobelenus@a44c68f

Let me know if this was in-line with what you were thinking or is gonna have serious side-affects. You know this far far better than I, and have already implemented this "waiting" affect for LABjs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant