addExisting method

void addExisting({
  1. String scope = BaseScopes.global,
  2. required BaseKoreInstance instance,
})

Adds existing instance to collection

scope - string scope value instance - given instance to add

Implementation

void addExisting({
  String scope = BaseScopes.global,
  required BaseKoreInstance instance,
}) {
  final id = instance.runtimeType.toString();

  container.addObjectInScope(object: instance, type: id, scopeId: scope);
}