本文整理汇总了TypeScript中rxjs/operator/distinctUntilChanged.distinctUntilChanged类的典型用法代码示例。如果您正苦于以下问题:TypeScript distinctUntilChanged类的具体用法?TypeScript distinctUntilChanged怎么用?TypeScript distinctUntilChanged使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了distinctUntilChanged类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: if
export function select<T, R>(pathOrMapFn: any, ...paths: string[]): Observable<R> {
let mapped$: Observable<R>;
if (typeof pathOrMapFn === 'string') {
mapped$ = pluck.call(this, pathOrMapFn, ...paths);
}
else if (typeof pathOrMapFn === 'function') {
mapped$ = map.call(this, pathOrMapFn);
}
else {
throw new TypeError(`Unexpected type ${ typeof pathOrMapFn } in select operator,`
+ ` expected 'string' or 'function'`);
}
return distinctUntilChanged.call(mapped$);
}
开发者ID:MikeRyan52,项目名称:core,代码行数:16,代码来源:select.ts
示例2: selectOperator
return function selectOperator(source$: Store<T>): Store<K> {
let mapped$: Store<any>;
if (typeof pathOrMapFn === 'string') {
mapped$ = pluck.call(source$, pathOrMapFn, ...paths);
} else if (typeof pathOrMapFn === 'function') {
mapped$ = map.call(source$, pathOrMapFn);
} else {
throw new TypeError(
`Unexpected type '${typeof pathOrMapFn}' in select operator,` +
` expected 'string' or 'function'`
);
}
return distinctUntilChanged.call(mapped$);
};
开发者ID:WinGood,项目名称:platform,代码行数:16,代码来源:store.ts
示例3: select
select(
pathOrMapFn: ((state: T) => any) | string,
...paths: string[]
): Store<any> {
let mapped$: Store<any>;
if (typeof pathOrMapFn === 'string') {
mapped$ = pluck.call(this, pathOrMapFn, ...paths);
} else if (typeof pathOrMapFn === 'function') {
mapped$ = map.call(this, pathOrMapFn);
} else {
throw new TypeError(
`Unexpected type '${typeof pathOrMapFn}' in select operator,` +
` expected 'string' or 'function'`
);
}
return distinctUntilChanged.call(mapped$);
}
开发者ID:rjokelai,项目名称:platform,代码行数:19,代码来源:store.ts
示例4:
select<R>(pathOrMapFn: (state: T) => R): Observable<R> {
const mapped$: Observable<R> = map.call(this, pathOrMapFn);
return distinctUntilChanged.call(mapped$);
}
开发者ID:kekeh,项目名称:ngx-bootstrap,代码行数:5,代码来源:store.class.ts
注:本文中的rxjs/operator/distinctUntilChanged.distinctUntilChanged类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论