core: avoid fixed :csys domain, always use input domain
This commit is contained in:
parent
d4f58655ca
commit
311261cd02
1 changed files with 5 additions and 4 deletions
|
|
@ -63,7 +63,7 @@ defmodule Scopes.Core do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def data_only(), do: filter_head([:csys, :data])
|
def data_only(dom \\ :csys), do: filter_head([dom, :data])
|
||||||
|
|
||||||
# send shortcuts
|
# send shortcuts
|
||||||
|
|
||||||
|
|
@ -72,14 +72,15 @@ defmodule Scopes.Core do
|
||||||
Actor.send(rcvr, Shape.create(head, data: data))
|
Actor.send(rcvr, Shape.create(head, data: data))
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_value(rcvr, val) do
|
def send_value(rcvr, val, dom \\ :csys) do
|
||||||
send_message(rcvr, [:csys, :data], %{value: val})
|
send_message(rcvr, [dom, :data], %{value: val})
|
||||||
end
|
end
|
||||||
|
|
||||||
# notifications
|
# notifications
|
||||||
|
|
||||||
def notify_created(msg, new, scope) do
|
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}))
|
data: Map.merge(Shape.data(msg), %{old: self(), new: new}))
|
||||||
notify(msg1, scope)
|
notify(msg1, scope)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue