diff options
Diffstat (limited to 'lib/lkn/core/properties.ex')
-rw-r--r-- | lib/lkn/core/properties.ex | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/lkn/core/properties.ex b/lib/lkn/core/properties.ex index 241407c..d8e2d0a 100644 --- a/lib/lkn/core/properties.ex +++ b/lib/lkn/core/properties.ex @@ -37,4 +37,9 @@ defmodule Lkn.Core.Properties do def write(entity_key, prop, v) do Agent.update(Lkn.Core.Name.properties(entity_key), &Map.put(&1, prop, v)) end + + @spec compute(Lkn.Core.Entity.k, (%{Lkn.Core.Entity.prop => Lkn.Core.Entity.value} -> any)) :: any + def compute(entity_key, function) do + Agent.get(Lkn.Core.Name.properties(entity_key), function) + end end |