Last active
April 3, 2018 12:44
-
-
Save indongyoo/986b6cc224487f8b4e745b2b243bd65a to your computer and use it in GitHub Desktop.
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
const { map, some } = Functional; | |
const f13 = pipe( | |
map(a => new Promise(function(resolve) { | |
resolve(a + 5); | |
})), | |
some(a => a > 10), // <- map에서 비동기를 제어한 후 some에 [10, 15, 20] 전달 | |
console.log | |
).error( | |
e => console.log('err --->', e) | |
); | |
f13([5, 10, 15]); // true (정상 동작) | |
const f14 = pipe( | |
map(a => new Promise(function(resolve, reject) { | |
reject(`${a} reject!`); // 10, 15 는 실행되지 않습니다. | |
})), | |
some(a => a > 10), // <-- 여기에 오지 않습니다. | |
console.log // <-- 여기에 오지 않습니다. | |
).error( | |
e => console.log('err --->', e) | |
); | |
f14([5, 10, 15]); // err ---> 5 reject! | |
const f15 = pipe( | |
map(a => a + 5), | |
some(a => new Promise(function() { | |
Grrrr Kack Kack Bang Bang; | |
})), | |
console.log // <-- 여기에 오지 않습니다. | |
).error( | |
e => console.log('aya ~ ', e) | |
); | |
f15([5, 10, 15]); // aya ~ ReferenceError: Grrrr Kack Kack Bang Bang is not defined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment