@rbxts/covenant 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ export declare class EventMapWithInstance<T extends defined> {
|
|
|
17
17
|
set(instance: Instance, key: RBXScriptSignal, value: T): this;
|
|
18
18
|
delete(instance: Instance, key: RBXScriptSignal): boolean;
|
|
19
19
|
clear(): void;
|
|
20
|
-
|
|
20
|
+
deleteInstance(instance: Instance): boolean;
|
|
21
21
|
isEmpty(): boolean;
|
|
22
22
|
isInstanceEmpty(instance: Instance): boolean;
|
|
23
23
|
forEach(callbackfn: (value: T, key: RBXScriptSignal) => void): void;
|
|
@@ -114,6 +114,9 @@ do
|
|
|
114
114
|
local _instance_1 = instance
|
|
115
115
|
local _eventMap = eventMap
|
|
116
116
|
_instanceEventMaps_1[_instance_1] = _eventMap
|
|
117
|
+
instance.Destroying:Once(function()
|
|
118
|
+
self:deleteInstance(instance)
|
|
119
|
+
end)
|
|
117
120
|
end
|
|
118
121
|
eventMap:set(key, value)
|
|
119
122
|
return self
|
|
@@ -130,7 +133,7 @@ do
|
|
|
130
133
|
function EventMapWithInstance:clear()
|
|
131
134
|
table.clear(self.instanceEventMaps)
|
|
132
135
|
end
|
|
133
|
-
function EventMapWithInstance:
|
|
136
|
+
function EventMapWithInstance:deleteInstance(instance)
|
|
134
137
|
local _instanceEventMaps = self.instanceEventMaps
|
|
135
138
|
local _instance = instance
|
|
136
139
|
-- ▼ Map.delete ▼
|
|
@@ -285,6 +288,9 @@ do
|
|
|
285
288
|
local _instance_1 = instance
|
|
286
289
|
local _eventSet = eventSet
|
|
287
290
|
_instanceEventSets_1[_instance_1] = _eventSet
|
|
291
|
+
instance.Destroying:Once(function()
|
|
292
|
+
self:deleteInstance(instance)
|
|
293
|
+
end)
|
|
288
294
|
end
|
|
289
295
|
eventSet:add(value)
|
|
290
296
|
return self
|