shared<T> abstract method

T shared<T>(
  1. ObjectFactory<T> create, {
  2. Disposer<T>? dispose,
})

Creates a shared instance using the provided factory function. Optionally, a disposer function can be provided to dispose of the instance.

Implementation

T shared<T>(
  ObjectFactory<T> create, {
  Disposer<T>? dispose,
});