lib/motion/observation.rb in rm-extensions-0.1.1 vs lib/motion/observation.rb in rm-extensions-0.1.2
- old
+ new
@@ -142,10 +142,10 @@
key_paths = @targets[target] || {}
blocks = key_paths[key_path] || []
blocks.each do |block|
args = [ change[NSKeyValueChangeNewKey] ]
args << change[NSKeyValueChangeIndexesKey] if collection?(change)
- block.call(*args)
+ rmext_on_main_q { block.call(*args) }
end
end
def collection?(change)
COLLECTION_OPERATIONS.include?(change[NSKeyValueChangeKindKey])