Re: Updated spec examples with Futures

Looks nicer than the on_event things.

".done(console.log.bind(console, "The signature is: 
"),console.error.bind(console, "Unable to sign"));"

Not sure everybody is familiar with bind(this,args)...

If I want to use Future result, I suppose :

.done(function() {console.log(this.result)})

or (direct result as the last example)

.done(function(result) {console.log(result)})

Can I do :

var h=window.crypto.digest("sha1");
var res1=h.process(stream1);
res1.finish().done(
     function() {
         console.log(this.result); //result 1
     }
);
var res2=res1.process(stream2);
res2.finish().done(
     function() {
         console.log(this.result); //result 1+2
     }
);

Regards,

Le 25/04/2013 11:51, Alex Russell a écrit :
> As per yesterday's discussion, I've updated the github repo with 
> re-worked examples:
>
> https://github.com/slightlyoff/DOMFuture/commit/614dcbb347962092a2b55a85980c9cc9732175f1
>
> Regards

-- 
jCore
Email :  avitte@jcore.fr
iAnonym : http://www.ianonym.com
node-Tor : https://www.github.com/Ayms/node-Tor
GitHub : https://www.github.com/Ayms
Web :    www.jcore.fr
Webble : www.webble.it
Extract Widget Mobile : www.extractwidget.com
BlimpMe! : www.blimpme.com

Received on Thursday, 25 April 2013 14:16:19 UTC