Last active
December 29, 2015 14:09
-
-
Save rads/7682420 to your computer and use it in GitHub Desktop.
CSP.js Issue #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
regenerator index.js > index_compiled.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.getTemplatesCSP = function (successC, errorC) { | |
var go = CSP.go; | |
var put = CSP.put; | |
$http.get('api/templates').success(function (data) { | |
templates = data; | |
go(function*() { | |
yield put(successC, data); | |
}); | |
}).error(function (err) { | |
go(function*() { | |
yield put(errorC, err.Message); | |
}); | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.getTemplatesCSP = function (successC, errorC) { | |
var go = CSP.go; | |
var put = CSP.put; | |
$http.get('api/templates').success(function (data) { | |
templates = data; | |
go(wrapGenerator.mark(function() { | |
return wrapGenerator(function($ctx) { | |
while (1) switch ($ctx.next) { | |
case 0: | |
$ctx.next = 2; | |
return put(successC, data); | |
case 2: | |
case "end": | |
return $ctx.stop(); | |
} | |
}, this); | |
})); | |
}).error(function (err) { | |
go(wrapGenerator.mark(function() { | |
return wrapGenerator(function($ctx) { | |
while (1) switch ($ctx.next) { | |
case 0: | |
$ctx.next = 2; | |
return put(errorC, err.Message); | |
case 2: | |
case "end": | |
return $ctx.stop(); | |
} | |
}, this); | |
})); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment