Forked from jhusain/gist:d6007e9cce59ac6f173449cd6841f9fc
Created
May 21, 2017 20:43
-
-
Save rcanepa/100fa510569c9ee0b320c9188471e713 to your computer and use it in GitHub Desktop.
"Animations Allowed" problem
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
someObservable.retry(3) | |
consts tasks = | |
{ | |
....{....5......2.......3...} | |
............{......5............4....3} | |
............................................{5...2...4} | |
.....................................................{...5} | |
} | |
tasks.map(task => task.filter(() => false)); | |
consts tasks = | |
{ | |
....{...........,...........} | |
............{.........................} | |
............................................{.........} | |
.....................................................{....} | |
} | |
tasks.map(task => | |
Observable.concat( | |
Observable.of(1), | |
task.filter(() => false), | |
Observable.of(-1))) | |
consts tasks = | |
{ | |
....{1...........,........-1} | |
............{1.......................-1} | |
............................................{1.......-1} | |
....................................................{1...-1} | |
} | |
tasks. | |
map(task => | |
Observable.concat( | |
Observable.of(1), | |
task.filter(() => false), | |
Observable.of(-1))). | |
mergeAll() | |
{....1.....1..............-1...........-1....1.......1.-1...-1} | |
tasks. | |
map(task => | |
Observable.concat( | |
Observable.of(1), | |
task.filter(() => false), | |
Observable.of(-1))). | |
mergeAll(). | |
scan((acc, curr) => acc + curr, 0) | |
{....1.....2...............1...........0...1.......2..1...0} | |
tasks. | |
map(task => | |
Observable.concat( | |
Observable.of(1), | |
task.filter(() => false), | |
Observable.of(-1))). | |
mergeAll(). | |
scan((acc, curr) => acc + curr, 0). | |
map(value => value === 0) | |
{....false...false...............false.true..f......f.f...true} | |
tasks. | |
map(task => | |
Observable.concat( | |
Observable.of(1), | |
task. | |
filter(() => false). | |
catch((e) => Observable.error(new SomeError(e))), | |
Observable.of(-1))). | |
mergeAll(). | |
scan((acc, curr) => acc + curr, 0). | |
map(value => value === 0). | |
distinctUntilChanged(); | |
animationsAllowed = | |
{...false..............................true.false.........true | |
let animsAllowed = true; | |
animationsAllowed.subscribe(val => animsAllowed = val); | |
try { | |
dosomething() | |
} | |
catch(e) { | |
throw OtherError(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment