本文整理汇总了TypeScript中b-o-a.O.combineLatest方法的典型用法代码示例。如果您正苦于以下问题:TypeScript O.combineLatest方法的具体用法?TypeScript O.combineLatest怎么用?TypeScript O.combineLatest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类b-o-a.O
的用法示例。
在下文中一共展示了O.combineLatest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: counter
const handler: Handler = (action$: O<A<any>>, options: any): O<A<any>> => {
return O.combineLatest<State>(
counter(action$, { count: 0 }),
(counter) => ({ counter })
)
.map(state => create(state));
};
示例2: getDefaultState
const $ = (action$: O<A<any>>, state: State): O<State> => {
const s = (state ? state : getDefaultState());
return O
.combineLatest(
currentPage$(s.currentPage, action$),
signIn$(s.signIn, action$),
token$(s.token, action$),
spots$(s.spots, action$),
spotForm$(s.spotForm, action$),
stampRallies$(s.stampRallies, action$),
stampRally$(s.stampRally, action$),
stampRallyForm$(s.stampRallyForm, action$),
(
currentPage,
signIn,
token,
spots,
spotForm,
stampRallies,
stampRally,
stampRallyForm
): State => {
return Object.assign({}, s, {
currentPage,
signIn,
token,
spots,
spotForm,
stampRallies,
stampRally,
stampRallyForm
});
}
)
.do(console.log.bind(console)) // logger for state
.share();
};