event fixes
This commit is contained in:
@@ -35,7 +35,7 @@ class HookedMapping(HookedContainer[T], MutableMapping[T, MutableNesting[T]]):
|
||||
def insert(self, key: T, value: MutableNesting[T]) -> None:
|
||||
self._data[key] = value
|
||||
if self.hook:
|
||||
self.hook(e.AddItemEvent(value, path=self.new_path(key)))
|
||||
self.hook(e.AddItemEvent(self.new_path(key), value))
|
||||
|
||||
# HookedContainer methods
|
||||
|
||||
@@ -58,10 +58,10 @@ class HookedMapping(HookedContainer[T], MutableMapping[T, MutableNesting[T]]):
|
||||
else:
|
||||
self._data[key] = value
|
||||
if self.hook:
|
||||
self.hook(e.SetItemEvent(value, path=self.new_path(key)))
|
||||
self.hook(e.SetItemEvent(self.new_path(key), value))
|
||||
|
||||
def __delitem__(self, key: T) -> None:
|
||||
item = self._data[key]
|
||||
del self._data[key]
|
||||
if self.hook:
|
||||
self.hook(e.RemoveItemEvent(item, path=self.new_path(key)))
|
||||
self.hook(e.RemoveItemEvent(self.new_path(key), item))
|
||||
|
||||
Reference in New Issue
Block a user