当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript xstream.empty函数代码示例

本文整理汇总了TypeScript中xstream.empty函数的典型用法代码示例。如果您正苦于以下问题:TypeScript empty函数的具体用法?TypeScript empty怎么用?TypeScript empty使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了empty函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

 constructor(private _mockConfig: MockConfig) {
   if (_mockConfig['elements']) {
     this._elements = _mockConfig['elements'] as FantasyObservable;
   } else {
     this._elements = adapt(xs.empty());
   }
 }
开发者ID:whitecolor,项目名称:cyclejs,代码行数:7,代码来源:mockDOMSource.ts

示例2: constructor

 constructor(private _mockConfig: MockConfig) {
   if (_mockConfig.elements) {
     this._elements = _mockConfig.elements as FantasyObservable<any>;
   } else {
     this._elements = adapt(xs.empty());
   }
 }
开发者ID:cyclejs,项目名称:cyclejs,代码行数:7,代码来源:mockDOMSource.ts

示例3: constructor

 constructor(private _streamAdapter: StreamAdapter,
             private _mockConfig: MockConfig) {
   if (_mockConfig.elements) {
     this._elements = _mockConfig.elements;
   } else {
     this._elements = _streamAdapter.adapt(xs.empty(), xsSA.streamSubscribe);
   }
 }
开发者ID:E-LLP,项目名称:dom,代码行数:8,代码来源:mockDOMSource.ts

示例4: switch

 .map((e: KeyboardEvent) => {
   switch (e.keyCode) {
     case 188:
       return xs.of('decrement');
     case 190:
       return xs.of('increment');
     default:
       return xs.empty();
   }
 }).flatten()
开发者ID:justinwoo,项目名称:tracker,代码行数:10,代码来源:keyboard.ts

示例5: events

  public events(eventType: string, options?: EventsFnOptions): any {
    const streamForEventType = this._mockConfig[eventType] as any;
    const out: DevToolEnabledSource & FantasyObservable = adapt(
      streamForEventType || xs.empty(),
    );

    out._isCycleSource = 'MockedDOM';

    return out;
  }
开发者ID:joeldentici,项目名称:cyclejs,代码行数:10,代码来源:mockDOMSource.ts

示例6: child

 .map(i => {
   if (i % 2 === 1) {
     return child(sources, i);
   } else {
     return {
       HTTP: xs.empty(),
       DOM: xs.of(''),
     };
   }
 });
开发者ID:ntilwalli,项目名称:cyclejs,代码行数:10,代码来源:run.ts

示例7: it

  it('propagates errors', done => {
    const Time = timeDriver(xs.empty());

    xs.throw(new Error())
      .compose(Time.debounce(1))
      .addListener({
        error(err: Error) {
          done();
          Time.dispose();
        },
      });
  });
开发者ID:ntilwalli,项目名称:cyclejs,代码行数:12,代码来源:time-driver.ts

示例8: events

 public events(eventType: string, options: EventsFnOptions): any {
   const mockConfig = this._mockConfig;
   const keys = Object.keys(mockConfig);
   const keysLen = keys.length;
   for (let i = 0; i < keysLen; i++) {
     const key = keys[i];
     if (key === eventType) {
       return mockConfig[key];
     }
   }
   return this._streamAdapter.adapt(xs.empty(), xsSA.streamSubscribe);
 }
开发者ID:E-LLP,项目名称:dom,代码行数:12,代码来源:mockDOMSource.ts


注:本文中的xstream.empty函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。