Typing of of Observable.create
See original GitHub issueRxJS version: 4.5.2
The TypeScript signature for Observable.create
is just:
static create: Function;
Is there a reason it can’t be given a richer type?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
what's the correct way to create a typed Observable with RxJS?
Just use a subject myWork$ = new Subject<MyData>();. and you can call next when you want it to emit update(data: MyData) { this....
Read more >Using observables to pass values - Angular
Use the Observable constructor to create an observable stream of any type. The constructor takes as its argument the subscriber function to run...
Read more >Observable - RxJS
An Observable is a lazily evaluated computation that can synchronously or asynchronously return zero to (potentially) infinite values from the time it's invoked ......
Read more >Creating Observables in RxJS - This Dot Labs
The fromEvent operator will create an Observable that pushes a every event of a specified type that has occurred on a specified event...
Read more >Create operator - ReactiveX
You can create an Observable from scratch by using the Create operator. You pass this operator a function that accepts the observer as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Because TypeScript does not let static properties type change from parent to base classes, and subject’s
create
method takes 2 arguments.https://github.com/ReactiveX/rxjs/blob/d2a32f9a18ebbf65bea798f558364571c91a9d79/src/Subject.ts#L42
FWIW I’ve just switched to using the constructor and it works just fine, and frankly that’s all
create
is doing anyway.This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.