📜  理解 Observable.create( - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:00.759000             🧑  作者: Mango

代码示例1
import { Observable } from "rxjs/Observable";

var observable = Observable.create(function subscribe(observer) {
    observer.next('Hey guys!')
})

// OR 

var observable = Observable.create((observer:any) => {
    observer.next('Hey guys!')
})