MokoJs / moko

Generator powered models
51 stars 3 forks source link

Modella co options? #1

Closed alexmingoia closed 10 years ago

alexmingoia commented 10 years ago

Is it not feasible to add an option to Modella to wrap all the functions that take a callback for use with co?

rschmukler commented 10 years ago

It is potentially feasible, but it's limited compared to the power that built from day one could offer...

For example, async events are much easier with co-emitter where you can use generators to yield execution to async events. This always felt dirty in modella, and is a big enhancement of moko.

The big problem is how does modella know when to yield to things on async (for example model.save) vs use a callback. Supporting both, if possible, would be a massive hack.

Other improvements over modella, in my opinion:

alexmingoia commented 10 years ago

yeah that makes sense. cool!