TwistingTwists
Best Practices from LiveBeats App
This is a thread to note down things/best practices encountered in LiveBeats App as I explore the source code.
https://github.com/fly-apps/live_beats/blob/master/lib/live_beats_web/controllers/user_auth.ex#L29
Found this usage of rescue/1
I’ve been meaning to handle Ecto errors myself. So this comes in handy for next time.
First Post!
cvkmohan
Most Liked
dorgan
Protip: if you press Y while seeing a github file it replaces the url at the address bar with a permalink so you can copy that instead of scrolling and clicking copy permalink
RudManusachi
First of all, thank you for this initiative!
https://github.com/fly-apps/live_beats/blob/master/lib/live_beats_web/live/live_helpers.ex#L494
Never seen a for loop like this before.
I’d recommend to post a “permalink” to the line in the commit. That file was changed 7 hours ago. And looks like the link doesn’t point to the place you meant to.
mcrumm
Check out the Phoenix.HTML docs for Link.link/2– You can override the default (:get) link method. You can also provide a data-confirm attribute to prompt the user before following the link. This is all ancient UX stuff that you get when you include phoenix_html.js. ![]()
Almost certainly, but take a look at router.ex to be sure. You don’t want to put destructive actions behind a GET method (especially a public one) otherwise any request to the path will trigger the destructive action. Imagine a search engine spidering your delete links– it’s not ideal.
Last Post!
03juan
I also think this is a great topic and encourage everyone to start threads on investigating other systems of interest. Well done ![]()
I assume this is so you can capture telemetry data at the same time as certain events happen, but if you’re only interested in having parts of the system react to events without capturing the telemetry, you use pubsub.
Another use case could be that when you’re handling the telemetry event you then want to broadcast some other data, or additional data, than what was received from the telemetry event. So you can broadcast a different payload as needed.
Popular in Guides/Tuts
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










