Created
June 2, 2017 10:48
-
-
Save Oziabr/3b53102d3031444ded8a6df440a8a132 to your computer and use it in GitHub Desktop.
angular2 resolver helper
This file contains hidden or 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
let resolver = (sbj, ctx = {}) => Observable.zip( ...Object.keys(sbj).map(k => sbj[k]), (...args) => | |
args.reduce((r, a, n) => Object.defineProperty(r, Object.keys(sbj)[n], {value: a, enumerable: true}) | |
, ctx)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment