local objects = {}

function unarchived(object)
    if object then
        objects[#objects + 1] = object
    else
        for index = 1, #objects do
            object = objects[index]
            object:notUndoably(function()
                object:unarchived()
            end)
        end
        objects = {}
    end
end

return unarchived