Conversation
4a1a93a to
165efd6
Compare
165efd6 to
4949433
Compare
packages/@ember/destroyable/type-tests/assert-destroyables-destroyed.test.ts
Show resolved
Hide resolved
| @@ -1,5 +1,6 @@ | |||
| import { typeOf } from './type-of'; | |||
| import Comparable from './mixins/comparable'; | |||
There was a problem hiding this comment.
TIL Ember's internal Comparable mixin. 😳
| until: 'forever', | ||
| for: 'me', | ||
| since: { enabled: '1.0.0' }, | ||
| since: { available: '1.0.0', enabled: '1.0.0' }, |
| '*/*/type-tests/**' /* scoped packages */, | ||
| '*/type-tests/**' /* packages */, |
| @public | ||
| */ | ||
| export const bind = (...curried) => { | ||
| export function bind< |
There was a problem hiding this comment.
One downside to trying to actually type bind, and why I ultimately chose not to on DT, is that it makes our bind stricter than TS' own. I'm fine with merging this for now, but we should plan to revisit it before publishing types; in general my inclination is to match what TS does (sometimes even at the cost of strictness) for clean interoperability with the rest of the ecosystem.
There was a problem hiding this comment.
We could also add a catch-all type to allow more?
There was a problem hiding this comment.
I'm also open to loosening it up if people find enough issues in practice.
There was a problem hiding this comment.
Yeah, I go back and forth on bind and friends. In general I think we should probably also just get rid of most of the stuff in @ember/runloop, including this, but that’s a different discussion entirely. 😅
| export function run() { | ||
| return _backburner.run(...arguments); | ||
| export function run<F extends (...args: any[]) => any>(method: F, ...args: Parameters<F>): void; | ||
| export function run<T, F extends (this: T, ...args: any[]) => any>( |
There was a problem hiding this comment.
We should check how this works compared to what I implemented on DT for Ember v4 types. The version on DT has some limitations, so this may be preferable. (Or you may have stolen it from there! I don’t remember exactly what I wrote. 😂)
Co-authored-by: Chris Krycho <hello@chriskrycho.com>
More type tests
More type tests
No description provided.