-
Notifications
You must be signed in to change notification settings - Fork 44
Feature/element missing broadcast #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/element missing broadcast #135
Conversation
test/integration/element_test.exs
Outdated
| {:ok, ret} = query_one(socket, "button", :style) | ||
| assert ret["style"]["cssText"] == "background-color: red; width: 200px;" | ||
|
|
||
| assert {:ok, :broadcasted} == |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no trailing white-space at the end of a line.
test/integration/element_test.exs
Outdated
| {:ok, ret} = query_one(socket, "a", :attributes) | ||
| assert ret["attributes"]["href"] == "https://tg.pl/drab" | ||
|
|
||
| assert {:ok, :broadcasted} == |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no trailing white-space at the end of a line.
test/integration/element_test.exs
Outdated
| {:ok, ret} = query_one(socket, "button", :dataset) | ||
| assert ret["dataset"]["foo"] == "bar" | ||
|
|
||
| assert {:ok, :broadcasted} == |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no trailing white-space at the end of a line.
test/integration/element_test.exs
Outdated
| assert {:ok, 1} == set_html(socket, "#my_element", html) | ||
| assert %{"innerHTML" => html} == query_one!(socket, "#my_element", :innerHTML) | ||
|
|
||
| assert {:ok, :broadcasted} == |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no trailing white-space at the end of a line.
|
Ebert has finished reviewing this Pull Request and has found:
But beware that this branch is 58 commits behind the You can see more details about this review at https://ebertapp.io/github/grych/drab/pulls/135. |
lib/drab/element.ex
Outdated
| See `Drab.Core.broadcast_js/2` for broadcasting options. | ||
| """ | ||
| @spec broadcast_style(Drab.Core.subject(), String.t(), map | Keyword.t()) :: Drab.Core.result() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return of broadcasting functions should be type of Drab.Core.bcast_result()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, yes! Damned copy/past..
lib/drab/element.ex
Outdated
| @doc """ | ||
| Exception-throwing version of `broadcast_style/3` | ||
| """ | ||
| @spec broadcast_style!(Drab.Core.subject(), String.t(), map | Keyword.t()) :: Drab.Core.return() | no_return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to have bang versions of broadcasting functions, as they work in "fire and forget" regime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. I saw that the bang version for broadcast_js exist so I thinked it was better to add these versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, it should not be there, I am going to depreciate this.
No description provided.