core: avoid fixed :csys domain, always use input domain

This commit is contained in:
Helmut Merz 2026-06-22 14:35:42 +02:00
parent d4f58655ca
commit 311261cd02

View file

@ -63,7 +63,7 @@ defmodule Scopes.Core do
end
end
def data_only(), do: filter_head([:csys, :data])
def data_only(dom \\ :csys), do: filter_head([dom, :data])
# send shortcuts
@ -72,14 +72,15 @@ defmodule Scopes.Core do
Actor.send(rcvr, Shape.create(head, data: data))
end
def send_value(rcvr, val) do
send_message(rcvr, [:csys, :data], %{value: val})
def send_value(rcvr, val, dom \\ :csys) do
send_message(rcvr, [dom, :data], %{value: val})
end
# notifications
def notify_created(msg, new, scope) do
msg1 = Shape.create(~w(csys created)a,
[dom | _rest] = Shape.head(msg)
msg1 = Shape.create([dom, :created],
data: Map.merge(Shape.data(msg), %{old: self(), new: new}))
notify(msg1, scope)
end