forceGet<MInstance extends MvvmInstance> method

  1. @visibleForTesting
MInstance? forceGet<MInstance extends MvvmInstance>({
  1. int? index,
  2. String scope = BaseScopes.global,
})

Forcibly tries to get instance for type

index - index for this instance scope - string scope to get instance from

Implementation

@visibleForTesting
MInstance? forceGet<MInstance extends MvvmInstance>({
  int? index,
  String scope = BaseScopes.global,
}) {
  return container.getObjectInScope(
    type: MInstance.toString(),
    scopeId: scope,
    index: index ?? 0,
  ) as MInstance?;
}