Current section
Files
Jump to
Current section
Files
lib/live_query/protocol/unlink.ex
defmodule LiveQuery.Protocol.Unlink do
@moduledoc """
TODO
"""
@enforce_keys [:query_key, :client_pid]
defstruct [:query_key, :client_pid]
@doc """
TODO
"""
def new(struct = %__MODULE__{}) do
struct
end
def new(opts) do
query_key = Access.fetch!(opts, :query_key)
false = is_nil(query_key)
client_pid = Access.fetch!(opts, :client_pid)
true = is_pid(client_pid)
%__MODULE__{
query_key: query_key,
client_pid: client_pid
}
end
end