New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

951 can model promises #956

Closed
wants to merge 8 commits into
base: minor
from

Conversation

Projects
None yet
5 participants
@retro
Contributor

retro commented May 3, 2014

This implements promise API for can.Model as mentioned in #951 . Docs are missing, but I'll add them if we agree on the implementation.

It adds the .get static function on the model which calls .findOne internally and returns a compute that holds the deferred object returned from the .findOne function. When this deferred is resolved or rejected compute is updated.

It also implements deferred state for the model instances which gets updated when destroy or save request is happening.

It has a demo similar to one in the can/list/promise plugin.

@ccummings ccummings added the Feature label May 7, 2014

@ccummings ccummings added this to the 2.2.0 milestone May 16, 2014

@daffl daffl modified the milestones: 2.3.0, 2.2.0 Jan 10, 2015

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer May 14, 2015

Contributor

@retro is this needed now that we have observable promises? I'm closing, please let me know if we need to reopen.

Contributor

justinbmeyer commented May 14, 2015

@retro is this needed now that we have observable promises? I'm closing, please let me know if we need to reopen.

@pYr0x

This comment has been minimized.

Show comment
Hide comment
@pYr0x

pYr0x Sep 4, 2015

the observable promises are not documentet yes
c141dae

pYr0x commented Sep 4, 2015

the observable promises are not documentet yes
c141dae

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Sep 4, 2015

Contributor

I'm not sure where we would document this. Possibly stache.keys. The promises themselves are not observable by can.compute. Instead, the template engine creates a shim of the promise that is observable.

Sent from my iPhone

On Sep 4, 2015, at 3:14 PM, pYr0x notifications@github.com wrote:

i do not found any documentation of that?


Reply to this email directly or view it on GitHub.

Contributor

justinbmeyer commented Sep 4, 2015

I'm not sure where we would document this. Possibly stache.keys. The promises themselves are not observable by can.compute. Instead, the template engine creates a shim of the promise that is observable.

Sent from my iPhone

On Sep 4, 2015, at 3:14 PM, pYr0x notifications@github.com wrote:

i do not found any documentation of that?


Reply to this email directly or view it on GitHub.

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Sep 4, 2015

Contributor

I was thinking of just creating a "Promises" page (in the Pages section at http://canjs.com/docs/can.stache.html) that talks about how to use it.

Contributor

daffl commented Sep 4, 2015

I was thinking of just creating a "Promises" page (in the Pages section at http://canjs.com/docs/can.stache.html) that talks about how to use it.

@daffl daffl deleted the 951-can-model-promises branch Apr 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment