Skip to content

Instantly share code, notes, and snippets.

View sarunast's full-sized avatar

Sarunas Tamasauskas sarunast

View GitHub Profile

Keybase proof

I hereby claim:

  • I am sarunast on github.
  • I am sarunast (https://keybase.io/sarunast) on keybase.
  • I have a public key whose fingerprint is ABF7 B8ED E68A 2265 8E53 DE4A 64B6 4B6D 0EEC EC54

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am sarunast on github.
  • I am sarunast (https://keybase.io/sarunast) on keybase.
  • I have a public key ASB2Wuhqiy6sexOe96cPm9HGQpyOOECfAacsKwxHgvoS9go

To claim this, I am signing this object:

@sarunast
sarunast / promise-example.js
Last active August 29, 2015 14:15
Promise chaining example (promised-io)
var Deferred = require("promised-io/promise").Deferred;
// 1st function with promise
var function1 = function(bool){
var deferred = new Deferred();
//add timeout for fun
setTimeout(function(){
bool ? deferred.resolve('yay1') : deferred.reject('no1');
}, 300);