Skip to content

Commit

Permalink
Merge pull request #32 from plastic-forks/zd/improve-doc
Browse files Browse the repository at this point in the history
Improve docs and fix a warning
  • Loading branch information
cheerfulstoic authored Oct 7, 2024
2 parents 921f171 + ceea458 commit de0d9eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions guides/introduction/Tracking columns and using labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ You can also use labels in general without tracking specific columns:
pub_sub: MyApp.PubSub,
watchers: [
# ...
{User, :updated, label: :user_update},
{User, :updated, label: :user_updated},
# ...
]}

# subscribing
EctoWatch.subscribe(:user_update)
EctoWatch.subscribe(:user_updated)
# or...
EctoWatch.subscribe(:user_update, package.id)
EctoWatch.subscribe(:user_updated, package.id)
# or...
EctoWatch.subscribe(:user_update, {:role_id, role_id})
EctoWatch.subscribe(:user_updated, {:role_id, role_id})

# handling messages
def handle_info({:user_update, %{id: id}}, socket) do
def handle_info({:user_updated, %{id: id}}, socket) do
```

1 change: 0 additions & 1 deletion lib/ecto_watch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ defmodule EctoWatch do
Supervisor.init(children, strategy: :rest_for_one)
end

@since "0.8.0"
@deprecated "subscribe/3 was removed in version 0.8.0. See the updated documentation"
def subscribe(schema_mod_or_label, update_type, id) when is_atom(schema_mod_or_label) do
if Helpers.ecto_schema_mod?(schema_mod_or_label) do
Expand Down

0 comments on commit de0d9eb

Please sign in to comment.