put<S> static method

S put<S>(
  1. S builder(), {
  2. String? tag,
  3. bool permanent = false,
})

Instantiates and registers a dependency.

The builder is executed immediately. If permanent is true, the instance survives a non-forced reset. Scope dispose always resets with force: true, so permanents do not leak across disposed scopes. Prefer permanent on root / long-lived scopes.

// Example usage:

final service = Levit.put(() => AuthService());

Implementation

static S put<S>(S Function() builder, {String? tag, bool permanent = false}) {
  return Ls.put<S>(builder, tag: tag, permanent: permanent);
}