Title: Need something more robust than polymorphic `this` typing for RxJS · Issue #5845 · microsoft/TypeScript · GitHub
Open Graph Title: Need something more robust than polymorphic `this` typing for RxJS · Issue #5845 · microsoft/TypeScript
X Title: Need something more robust than polymorphic `this` typing for RxJS · Issue #5845 · microsoft/TypeScript
Description: I was pretty excited about this typing for RxJS, since it does have a sort of "fluent" style interface. However we have some issues with it that are discussed here: ReactiveX/rxjs#846 Basically, we have operators that return same-shaped,...
Open Graph Description: I was pretty excited about this typing for RxJS, since it does have a sort of "fluent" style interface. However we have some issues with it that are discussed here: ReactiveX/rxjs#846 Basically, we...
X Description: I was pretty excited about this typing for RxJS, since it does have a sort of "fluent" style interface. However we have some issues with it that are discussed here: ReactiveX/rxjs#846 Bas...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/5845
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Need something more robust than polymorphic `this` typing for RxJS","articleBody":"I was pretty excited about `this` typing for RxJS, since it does have a sort of \"fluent\" style interface. However we have some issues with it that are discussed here: https://github.com/ReactiveX/RxJS/issues/846\n\nBasically, we have operators that return same-shaped, but different generic types:\n\n`map` for example: `Observable\u003cT>.prototype.map\u003cR>((value: T) => R): Observable\u003cR>` \n\nThe reason we were looking at `this` typing the above is that `map` doesn't always return an `Observable`, it could be called on a `Subject` which is a subclass of `Observable`. In that case, it actually returns a `Subject`, not an `Observable`, because of our fancy `lift` mechanism:\n\nThe Observable's lift:\nhttps://github.com/ReactiveX/RxJS/blob/2896556afe8b663d4f983da1830fe407841e7d5b/src/Observable.ts#L51-L63\n\nThe Subject's lift:\nhttps://github.com/ReactiveX/RxJS/blob/2896556afe8b663d4f983da1830fe407841e7d5b/src/Subject.ts#L37-L41\n\nHow lift is used (in `map` for example):\nhttps://github.com/ReactiveX/RxJS/blob/2896556afe8b663d4f983da1830fe407841e7d5b/src/operators/map.ts#L17\n\nIt would be fantastic if we could provide our TypeScript users with the proper type information in their IDEs. Perhaps some additional syntax like `this\u003cR>` would fit the bill? It's also worth noting that operators always return a new instance, rather than the same `this` instance, if that makes a difference.\n","author":{"url":"https://github.com/benlesh","@type":"Person","name":"benlesh"},"datePublished":"2015-12-01T01:33:22Z","url":"https://github.com/microsoft/TypeScript/issues/5845"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:535d72b4-8ec9-12a1-a174-867dbf2cd874 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E4E:21AC3F:143C73D:19B78D6:6B0111D4 |
| html-safe-nonce | 093e5b8b4af37bec8dd3429b3559d7f26e09d760a8a10422cdfb88aafe0b9c5d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTRFOjIxQUMzRjoxNDNDNzNEOjE5Qjc4RDY6NkIwMTExRDQiLCJ2aXNpdG9yX2lkIjoiODI1MzMwMjkwODMzNDk2OTMwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a30456e9070525743791a54fa93b2e4b223696544255fe335eed3611ec6ce8be |
| hovercard-subject-tag | issue:119620779 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/5845/issue_layout |
| twitter:image | https://opengraph.githubassets.com/501bc0e44dc89d05f4b6488851eea12f78d19856c7bfd15a2be2e0052191b551/microsoft/TypeScript/issues/5845 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/501bc0e44dc89d05f4b6488851eea12f78d19856c7bfd15a2be2e0052191b551/microsoft/TypeScript/issues/5845 |
| og:image:alt | I was pretty excited about this typing for RxJS, since it does have a sort of "fluent" style interface. However we have some issues with it that are discussed here: ReactiveX/rxjs#846 Basically, we... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | benlesh |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width