Get.delete update and some missing docs
- Added `Get.delete( force)` which was missing to manually remove permanent instances with Get.put(). - added missing doc comment to isPrepared()
Showing
2 changed files
with
11 additions
and
7 deletions
@@ -92,12 +92,16 @@ extension Inst on GetInterface { | @@ -92,12 +92,16 @@ extension Inst on GetInterface { | ||
92 | /// controllers ([DisposableInterface]). | 92 | /// controllers ([DisposableInterface]). |
93 | /// | 93 | /// |
94 | /// - [tag] Optional "tag" used to register the Instance | 94 | /// - [tag] Optional "tag" used to register the Instance |
95 | - Future<bool> delete<S>({String tag}) async => | ||
96 | - GetInstance().delete<S>(tag: tag); | 95 | + /// - [force] Will delete an Instance even if marked as [permanent]. |
96 | + Future<bool> delete<S>({String tag, bool force = false}) async => | ||
97 | + GetInstance().delete<S>(tag: tag, force: force); | ||
97 | 98 | ||
98 | - /// Check if a Class Instance<[S]> (or [tag]) is registered in memory. | 99 | + /// Checks if a Class Instance<[S]> (or [tag]) is registered in memory. |
99 | /// - [tag] optional, if you use a [tag] to register the Instance. | 100 | /// - [tag] optional, if you use a [tag] to register the Instance. |
100 | bool isRegistered<S>({String tag}) => GetInstance().isRegistered<S>(tag: tag); | 101 | bool isRegistered<S>({String tag}) => GetInstance().isRegistered<S>(tag: tag); |
101 | 102 | ||
103 | + /// Checks if an Instance<[S]> (or [tag]) returned from a factory builder | ||
104 | + /// [Get.lazyPut()], is registered in memory. | ||
105 | + /// - [tag] optional, if you use a [tag] to register the Instance. | ||
102 | bool isPrepared<S>({String tag}) => GetInstance().isPrepared<S>(tag: tag); | 106 | bool isPrepared<S>({String tag}) => GetInstance().isPrepared<S>(tag: tag); |
103 | } | 107 | } |
@@ -340,12 +340,12 @@ class GetInstance { | @@ -340,12 +340,12 @@ class GetInstance { | ||
340 | } | 340 | } |
341 | 341 | ||
342 | /// Check if a Class Instance<[S]> (or [tag]) is registered in memory. | 342 | /// Check if a Class Instance<[S]> (or [tag]) is registered in memory. |
343 | - /// - [tag] optional, if you use a [tag] to register the Instance. | 343 | + /// - [tag] is optional, if you used a [tag] to register the Instance. |
344 | bool isRegistered<S>({String tag}) => _singl.containsKey(_getKey(S, tag)); | 344 | bool isRegistered<S>({String tag}) => _singl.containsKey(_getKey(S, tag)); |
345 | 345 | ||
346 | - /// Checks if a lazy factory callback that returns an Instance<[S]> | ||
347 | - /// is registered. | ||
348 | - /// - [tag] optional, if you use a [tag] to register the Instance. | 346 | + /// Checks if a lazy factory callback ([Get.lazyPut()] that returns an |
347 | + /// Instance<[S]> is registered in memory. | ||
348 | + /// - [tag] is optional, if you used a [tag] to register the lazy Instance. | ||
349 | bool isPrepared<S>({String tag}) => _factory.containsKey(_getKey(S, tag)); | 349 | bool isPrepared<S>({String tag}) => _factory.containsKey(_getKey(S, tag)); |
350 | } | 350 | } |
351 | 351 |
-
Please register or login to post a comment