diff --git a/src/nat/Archive.kiss b/src/nat/Archive.kiss index 766f833..8326b50 100644 --- a/src/nat/Archive.kiss +++ b/src/nat/Archive.kiss @@ -29,8 +29,10 @@ (refreshEntry e) e)) -// After modifying an entry, this must be called. If you are writing in a createEntry initializer or a system's processEntry function, this will happen automatically. -// Otherwise, you can guarantee it happens automatically by using the (withWritableEntry) macro in Lib.kiss +// After modifying an entry, this must be called. If you are writing in a createEntry +// initializer or a system's processEntry function, this will happen automatically. +// Otherwise, you can guarantee it happens automatically by using the (withWritableEntry) +// and (withWritableComponents) macros in Lib.kiss (method refreshEntry [:Entry e] (_saveEntry e) (doFor system systems diff --git a/src/nat/System.kiss b/src/nat/System.kiss index 7f2bd3a..3577251 100644 --- a/src/nat/System.kiss +++ b/src/nat/System.kiss @@ -9,9 +9,13 @@ &prop :EntryProcessor processEntry] []) +(prop &mut :Null onRemoveEntry) + (method :Void checkEntryInOrOut [:Archive archive :Entry e] (if (canProcessEntry archive e) (dictSet entries e.id e) - (entries.remove e.id))) + (when (entries.exists e.id) + (entries.remove e.id) + (when onRemoveEntry (onRemoveEntry archive e))))) // TODO systems may need access to a UI