Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@darrenrahnemoon I think so
Observable.ts
export class Observable<T> implements Subscribable<T> {
/*...*/
subscribe(observer?: PartialObserver<T>): Subscription;
/*...*/
} -
I think this might happen if the signature of the methods don’t match but they have the same name. Can’t tell much from this example cuz it looks fine.
-
vBitza1673yTypescript is evil, it takes me 30 minutes to write the code and then 2 hours to fix all the ts compilation errors :/
-
It’s not that bad tbh helps a lllllot with cleaning up ur code. Static typing also makes it easier to code review ppls work. If it was just pure javascript I’d lose my mind code reviewing a 1000 line PR.
-
@darrenrahnemoon I agree, it's a lot better than plain js. However, the OOP-wannabe is killing me... I can't override methods I want, I can't use polymorphism freely, I can't cast types 'just like that' (why tf the 'as unknown' in the middle??), etc.
It's more like Python in terms of OOP. But worse. IMO it's somewhere between Python and javascript oop-wise. It kind of has OOP concepts, but not quite. -
@netikras read the docs top to bottom. I haven’t had any issues with polymorphism in TS. Also learn ur generic <T> utilities
Related Rants
-
linuxxx32*client calls in* Me: good morning, how can I help you? Client: my ip is blocked, could you unblock it for m...
-
DRSDavidSoft28Found this in our codebase, apparently one of my co-workers had written this
-
linuxxx23*client calls* "hello, we forgot the password to our WiFi router. Could you reset that for us?" 😐😶😮...
typescript, I HATE you!
ME: Trying to extend Subject and override Subject.subscribe(PartialObserver<T>)
ME: export class MySubject<T> extends Subject<T> {
subscribe(obs?:PartialObserver<T>): Subscription {
return super.subscribe(obs);
}
}
ME: compile
TS: Compilation error! No such method to override!
ME: load the app -- ERROR
ME: recompile
TS: Compilation error! No such method to override!
ME: load the app -- works perfectly
:confusedjackie:
Make up your mind! So is that class compileable or not???
If not -- how the fuck does it work then???
If yes -- why the fuck do you yell in my face with all those errors???
rant
rxjs
typescript
magic
wtf