You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want when.lift(f) but that returns a (thenable) object with an execute method. The object could even be an extension of a Promise, for maximum leverage but it's not important overall.
Something like: p(r) = when.task( r ); p.execute(....), p.then(...) where p(r) is a theable with a way to execute r(args); e.g. p.execute(args), on demand.
I was thinking of writing a factory method and extending when.Promise, since a function amplified with a record is a (future) unit of work that can be, named, composed etc..
With when.lift(f) , you get back a promisified fn. Even though I can merge properties on a function it seems awkward although with javascript that is more the perception then the reality perhaps 👍
g = when.lift(f) t = _.merge(g, {config}); g( args ); g as record;
if we had a flavor of when.lift, that returned an object with an execute method, it would be more reasonable to think of a lifted function as a deferred resolver as a record that has a an execute method. There is a writer monad in Haskell for instance that is similiar.
Is there room for this idea in a Promise library, and is there anything to gain from making the above ideas standardized ?
thanks
mark bjerke
The text was updated successfully, but these errors were encountered:
I want when.lift(f) but that returns a (thenable) object with an execute method. The object could even be an extension of a Promise, for maximum leverage but it's not important overall.
Something like: p(r) = when.task( r ); p.execute(....), p.then(...) where p(r) is a theable with a way to execute r(args); e.g. p.execute(args), on demand.
I was thinking of writing a factory method and extending when.Promise, since a function amplified with a record is a (future) unit of work that can be, named, composed etc..
With when.lift(f) , you get back a promisified fn. Even though I can merge properties on a function it seems awkward although with javascript that is more the perception then the reality perhaps 👍
g = when.lift(f) t = _.merge(g, {config}); g( args ); g as record;
if we had a flavor of when.lift, that returned an object with an execute method, it would be more reasonable to think of a lifted function as a deferred resolver as a record that has a an execute method. There is a writer monad in Haskell for instance that is similiar.
Is there room for this idea in a Promise library, and is there anything to gain from making the above ideas standardized ?
thanks
mark bjerke
The text was updated successfully, but these errors were encountered: