   end
 
   def defevent(pid, type, reducer, options \\ []) do
-    GenServer.call(pid, {:subscribe, fn ^type, args -> reducer.(args) end, options})
+    GenServer.call(pid, {:subscribe, reducer, options ++ [type: type]})
     # return a caller
     fn
       args ->

    GenServer.call(pid, {:dispatch, type, data})
  end

  def subscribe(pid, reducer, options \\ []) do
    GenServer.call(pid, {:subscribe, reducer, options})
  end

  def replay(pid, list_of_events) do

  end

  defp dispatchp(reducers, type, data) do
    for {reducer, options} <- reducers do
      try do
        case Keyword.get(options, :type, :any) do
          :any ->
            reducer.(type, data)
          ^type ->
            reducer.(data)
          _ ->
            nil
        end
      rescue
        e in FunctionClauseError ->
          # Some voodoo to check it it was us with a wrong action type, if so ignore
