本文整理汇总了TypeScript中xstream.fromArray函数的典型用法代码示例。如果您正苦于以下问题:TypeScript fromArray函数的具体用法?TypeScript fromArray怎么用?TypeScript fromArray使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fromArray函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test('xstream: proxy$ should not emit if target$ subscribed', (t) => {
let target$ = xs.fromArray([1, 2, 3, 5, 6])
let proxy$ = proxy()
proxy$.map(() => t.fail()).addListener(emptyListener)
proxy$.proxy(target$)
target$.addListener(emptyListener)
setTimeout(() => t.end())
})
示例2:
view = spin.map(spins => xs.fromArray(spins)
.map(gear => gear[tooth])
.filter(toothView => !!toothView)
.compose(flattenConcurrently))
示例3:
const homeworldsReq$: Stream<RequestOptions> = users$.map((users: User[]): Stream<RequestOptions> => {
return xs.fromArray(users.map((user: User): RequestOptions => {
return { url: user.homeworld, category: 'homeworld' }
}))
}).flatten()