( Base: TBase = EmptyBase as unknown as TBase, )
| 271 | Base: EnsureNoLoadConflict<TBase> extends TBase ? TBase : never, |
| 272 | ): LoadableConstructor<TBase> & TBase; |
| 273 | export function Loadable<TBase extends EntityConstructor>( |
| 274 | Base: TBase = EmptyBase as unknown as TBase, |
| 275 | ): LoadableConstructor<TBase> & TBase { |
| 276 | abstract class LoadableMixin extends Base { |
| 277 | async load(options?: LoadReferenceOptions<object>): Promise<object | null> { |
| 278 | return Reference.create(this).load(options) as Promise<object | null>; |
| 279 | } |
| 280 | |
| 281 | async loadOrFail(options?: LoadReferenceOrFailOptions<object>): Promise<object> { |
| 282 | return Reference.create(this).loadOrFail(options) as Promise<object>; |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | return LoadableMixin as unknown as LoadableConstructor<TBase> & TBase; |
| 287 | } |
| 288 | |
| 289 | const LoadableBaseEntityBase: LoadableConstructor<typeof BaseEntity> & typeof BaseEntity = Loadable(BaseEntity); |
| 290 |
no outgoing calls
no test coverage detected