當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript distinctUntilChanged.call方法代碼示例

本文整理匯總了TypeScript中rxjs/operator/distinctUntilChanged.distinctUntilChanged.call方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript distinctUntilChanged.call方法的具體用法?TypeScript distinctUntilChanged.call怎麽用?TypeScript distinctUntilChanged.call使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rxjs/operator/distinctUntilChanged.distinctUntilChanged的用法示例。


在下文中一共展示了distinctUntilChanged.call方法的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.call方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。