SingletonAsync constructor

const SingletonAsync({
  1. bool lazy = true,
  2. bool weak = false,
})

Creates a SingletonAsync annotation.

  • lazy: when true (the default) the instance is created on first access; when false it is created at module construction time.
  • weak: when true the instance may be garbage-collected when no strong references remain.

Implementation

const SingletonAsync({super.lazy = true, super.weak = false}) : super(singleton: true, async: true);