Angular2 - rxjs观察与处置?

时间:2017-01-09 21:28:20

标签: angular rxjs

取消订阅和处置之间的区别是什么?

e.g。

getTodos(): Promise<Todo[]> {
    return this.http.get(this.todosUrl)
    .toPromise()
    .then(response => { return response.json() as Todo[]})

1 个答案:

答案 0 :(得分:6)

这是rxjs4 - rxjs5差异;

rxjs4 Disposable dispose()Subscriptionunsubscribe(),现在var cp = require( 'child_process' ); var dbWatcher; if ( !processDoesExist ) { dbWatcher = cp.fork( __dirname + '/dbWatcher.js', [], {execArgv: ['--debug=5859']} ); } else { dbWatcher.send( message ); } cp.fork()

来源:https://github.com/ReactiveX/rxjs/blob/master/MIGRATION.md