diff --git a/lib/sample/projections/proj1.ex b/lib/sample/projections/proj1.ex index 2f9c405..37242e0 100644 --- a/lib/sample/projections/proj1.ex +++ b/lib/sample/projections/proj1.ex @@ -1,4 +1,14 @@ defmodule Sample.Projections.Proj1 do + @moduledoc """ + + ```elixir + ## reset projection + iex> Essig.Projections.Runner.reset(Sample.Projections.Proj1) + + ## fetch projection state + iex> Essig.Projections.Runner.get_state_data(Sample.Projections.Proj1) + ``` + """ use Essig.Projections.Projection alias Essig.Projections.Data use Essig.Repo @@ -13,6 +23,11 @@ defmodule Sample.Projections.Proj1 do {:ok, 1} end) + # update projection specific private data + private = data.private + private = Map.put(private, {:index, index}, true) + data = %Data{data | private: private} + {multi, data} end