From 311261cd02e464c3280b30d62a21eac04294686d Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Mon, 22 Jun 2026 14:35:42 +0200 Subject: [PATCH] core: avoid fixed :csys domain, always use input domain --- lib/core/core.ex | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/core/core.ex b/lib/core/core.ex index b16a0b2..1f1ad68 100644 --- a/lib/core/core.ex +++ b/lib/core/core.ex @@ -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