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 imgArray = [img1, img2, img3]; | |
// 이 함수는 이미지 크기나 종류에 따라 각기 다른 연산 시간을 가지는 작업을 하는 | |
// Promise 를 리턴한다. | |
function asyncFun(img) { | |
return new Promise((resolve) => { | |
setTimeout(() => { | |
resolve(img) | |
}, getRandomArbitrary(100, 1000)); | |
}); | |
} |
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
import { forkJoin, from, Observable } from 'rxjs'; | |
import { bufferCount, concatMap, last, scan } from "rxjs/operators"; | |
class Test { | |
someArray = [1,2,3,4,5,6,7,8,9,10,11,12]; | |
constructor() { | |
from(this.someArray).pipe( | |
bufferCount(3), | |
concatMap(this.controlChunk), |
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
import { from, Observable } from 'rxjs'; | |
import { bufferCount, concatMap, last, mergeMap, scan } from "rxjs/operators"; | |
class Test { | |
someArray = [1,2,3,4,5,6,7,8,9,10,11,12]; | |
constructor() { | |
from(this.someArray).pipe( | |
bufferCount(3), | |
concatMap(this.controlChunk), |
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
import { from } from "rxjs"; | |
import { bufferCount, concatMap, last, mergeMap, scan } from "rxjs/operators"; | |
class Test { | |
someArray = [1,2,3,4,5,6,7,8,9,10,11,12]; | |
constructor() { | |
from(this.someArray).pipe( | |
bufferCount(3), | |
concatMap((dividedArray: number[]) => |
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
import { from } from "rxjs"; | |
import { bufferCount, concatMap, last, mergeMap, scan } from "rxjs/operators"; | |
class Test { | |
someArray = [1,2,3,4,5,6,7,8,9,10,11,12]; | |
constructor() { | |
from(this.someArray).pipe( | |
bufferCount(3), | |
concatMap((dividedArray: number[]) => |
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
import { from, of } from "rxjs"; | |
import { bufferCount, concatMap } from "rxjs/operators"; | |
class Test { | |
someArray = [1,2,3,4,5,6,7,8,9,10,11,12]; | |
constructor() { | |
from(this.someArray).pipe( | |
bufferCount(3), | |
concatMap((dividedArray: number[]) => of(dividedArray)), |
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
import { from } from "rxjs"; | |
import { concatMap, last, scan } from 'rxjs/operators'; | |
class Test { | |
someArray = [1,2,3,4,5,6,7,8,9,10,11,12]; | |
constructor() { | |
from(this.someArray).pipe( | |
concatMap(this.delayedPromise), | |
scan((acc: number[], curr: number) => [...acc, curr], []), |
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
import { from } from "rxjs"; | |
import { concatMap } from 'rxjs/operators'; | |
class Test { | |
someArray = [1,2,3,4,5,6,7,8,9,10,11,12]; | |
constructor() { | |
from(this.someArray).pipe( | |
concatMap(this.delayedPromise) | |
).subscribe(console.log) |
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
import { from } from "rxjs"; | |
import { mergeMap } from 'rxjs/operators'; | |
class Test { | |
someArray = [1,2,3,4,5,6,7,8,9,10,11,12]; | |
constructor() { | |
from(this.someArray).pipe( | |
mergeMap(this.delayedPromise) | |
).subscribe(console.log) |
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
import { Component, OnInit } from "@angular/core"; | |
@Component({ | |
selector: "browser-check", | |
templateUrl: "./browser-check.component.html", | |
styleUrls: ["./browser-check.component.scss"] | |
}) | |
export class BrowserCheckComponent implements OnInit { | |
constructor() {} |
NewerOlder