File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export class Data<Type> extends DataCore<Type> {
37
37
#value;
38
38
39
39
/**
40
- * Creates an instance of `Data` child class .
40
+ * Creates an instance of `Data`.
41
41
* @constructor
42
42
* @param {Type } value Initial data value of generic type variable `Type`.
43
43
*/
@@ -46,10 +46,20 @@ export class Data<Type> extends DataCore<Type> {
46
46
this . #value = new Value ( value ) ;
47
47
}
48
48
49
+ /**
50
+ * @description Clears the value to `null`.
51
+ * @public
52
+ * @returns {this } Returns `this` current instance.
53
+ */
54
+ public clear ( ) : this {
55
+ this . #value. set ( null as unknown as Type ) ;
56
+ return this ;
57
+ }
58
+
49
59
/**
50
60
* @description Destroys the `Value` object by setting it to `null`.
51
61
* @public
52
- * @returns {this } Returns the current instance.
62
+ * @returns {this } Returns `this` current instance.
53
63
*/
54
64
public destroy ( ) : this {
55
65
this . #value = null as any ;
@@ -60,7 +70,7 @@ export class Data<Type> extends DataCore<Type> {
60
70
* @description Sets the data value.
61
71
* @public
62
72
* @param {Type } value The data of `Type` to set.
63
- * @returns {this } Returns the current instance.
73
+ * @returns {this } Returns `this` current instance.
64
74
*/
65
75
public set ( value : Type ) {
66
76
super . validate ( ) ;
You can’t perform that action at this time.
0 commit comments