The new unreleased type declarations want me to type FragmentArray like this:
import type { FragmentArray } from 'ember-data-model-fragments/attributes';
interface Args {
model: FragmentArray<'user'>;
}
and not like this:
import type { FragmentArray } from 'ember-data-model-fragments/attributes';
import type UserModel from 'my-app/models/user';
interface Args {
model: FragmentArray<UserModel>;
}
Shouldn't we be passing in the full class to the generic? Otherwise iterating over fragment array just yields the registry keys instead of the actual objects, according to the TypeScript declarations.
The new unreleased type declarations want me to type
FragmentArray
like this:and not like this:
Shouldn't we be passing in the full class to the generic? Otherwise iterating over fragment array just yields the registry keys instead of the actual objects, according to the TypeScript declarations.