本文整理匯總了TypeScript中rx.Observable.concat方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Observable.concat方法的具體用法?TypeScript Observable.concat怎麽用?TypeScript Observable.concat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rx.Observable
的用法示例。
在下文中一共展示了Observable.concat方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('Loads the PHP words', () => {
const rxWords0 = loadWordsRx(__dirname + '/../../dictionaries/php.txt');
const rxWords1 = loadWordsRx(__dirname + '/../../dictionaries/php.txt');
const p = Rx.Observable.concat([
wlh.processWordsRx(rxWords0)
.scan(scanTimer, {})
.last()
.map(({elapsedTs}) => elapsedTs)
.map(diffToMs)
,
wlh.processWordListLinesRx(rxWords1, minWordLength)
.scan(scanTimer, {})
.last()
.map(({elapsedTs}) => elapsedTs)
.map(diffToMs)
])
.toArray()
.toPromise();
return p.then(([diff0, diff1]) => {
consoleLog(`Timing: new - ${diff0}, old - ${diff1} ratio: ${(diff1 / diff0 - 1) * 100}%`);
expect(diff0).to.be.lessThan(diff1);
});
});
示例2: makeWebHook
export function makeWebHook (
initialState: TcombUpdatesState,
action: Subject<TcombUpdate[]>
): Observable<TcombUpdatesState> {
UpdatesState(initialState)
let webHookUpdates = action.share()
return $.concat<TcombUpdatesState>(
$.just(initialState),
webHookUpdates.map((updates: TcombUpdate[]) => UpdatesState({
startDate: initialState.startDate,
offset: reduce(max('update_id'), 0, updates) + 1,
updates
})))
.share()
}