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


TypeScript rxjs.Observable类代码示例

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


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

示例1:

 const project = (value: number, index: number) => Observable.from(Promise.reject('' + value + '-' + index));
开发者ID:jaychsu,项目名称:RxJS,代码行数:1,代码来源:concatMap-spec.ts

示例2: handleObservableError

 protected handleObservableError(error: Response | any): Observable<any> {
     return Observable.throw(extractError(error));
 }
开发者ID:wpbarcelos,项目名称:ionicfirebasechat,代码行数:3,代码来源:base.service.ts

示例3: function

 loadData: function(){
   return Observable.of({});
 },
开发者ID:GSA,项目名称:sam-web-design-standards,代码行数:3,代码来源:baseexample.spec.ts

示例4: get

 get(url: string,
     options?: RequestOptionsArgs): Observable<Response> {
   return Observable.from([this.fakeResponse]);
 }
开发者ID:tessa3,项目名称:uxgraph,代码行数:4,代码来源:fake-http.ts

示例5:

 /**
  * Make Cold observable to Hot observable
  * 
  * On caller function will not need to make ".subscribe(...)" to execute procedure
  * 
  * @param cold Observable
  */
 public static makeHot<T>(cold: Observable<T>) {
   const subject = new Subject<T>();
   cold.subscribe(subject);
   return new Observable<T>((observer: any) => subject.subscribe(observer));
 }
开发者ID:PoompisekK,项目名称:myWork,代码行数:12,代码来源:rxjs.util.ts

示例6: publishAll

 private publishAll() {
   this.getAllSubject.next(
     Observable.fromPromise(this.db.getAll())
   )
 }
开发者ID:likr,项目名称:interactive-sem,代码行数:5,代码来源:projects-repository.service.ts

示例7:

 .catch(() => {
     return Observable.throw(LoadError.createGeneralError());
 });
开发者ID:feibeck,项目名称:fussi,代码行数:3,代码来源:point-log.service.ts

示例8: beforeEach

        beforeEach(() => {
            DevicesService.save.and.returnValue(Observable.of(sensorMock));
            DevicesService.update.and.returnValue(Observable.of(sensorMock));

            sut.sensor = sensorMock;
        });
开发者ID:garage-it,项目名称:SmartHouse-frontend,代码行数:6,代码来源:device-details-page.component.test.ts

示例9: constructor

 */
import * as _ from 'lodash';
import { Observable, Subscription } from 'rxjs';
import { CommandType, IAtomNavigation, IImplementationProvider, IImplementationService, Implementation, Reference, navigationHasRange } from 'atom-languageservices';
import { alias, injectable } from 'atom-languageservices/decorators';
import { readFile } from 'fs';
import { ProviderServiceBase } from './_ProviderServiceBase';
import { atomConfig } from '../decorators';
import { AtomCommands } from './AtomCommands';
import { AtomNavigation } from './AtomNavigation';
import { AtomTextEditorSource } from './AtomTextEditorSource';
import { CommandsService } from './CommandsService';
import { ReferenceView } from './views/ReferenceView';
type Location = IAtomNavigation.Location;

const readFile$ = Observable.bindNodeCallback(readFile);
@injectable
@alias(IImplementationService)
@atomConfig({
    default: true,
    description: 'Adds support for navigate to implementation or implementations'
})
export class ImplementationService
    extends ProviderServiceBase<IImplementationProvider, Implementation.IRequest, Observable<Location[]>, Observable<Location[]>>
    implements IImplementationService {
    private _navigation: AtomNavigation;
    private _commands: CommandsService;
    private _atomCommands: AtomCommands;
    private _source: AtomTextEditorSource;

    constructor(navigation: AtomNavigation, commands: CommandsService, atomCommands: AtomCommands, source: AtomTextEditorSource) {
开发者ID:OmniSharp,项目名称:atom-languageclient,代码行数:31,代码来源:ImplementationService.ts


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