Morzaram
Hey guys, I went through Chris McCords Twitter clone video and made the code that shows the 1.6 version, along with doing a broadcast delete. Not sure how best practice the delete is, but everything is functional.
I guess this is really for those who are looking for up to date info since the syntax change of 1.6
If you think it’d be helpful, I’d be down to record this video and go through my code, let me know!
Trending in Other Resources
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex










Showing Posts 1 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
PJextra
That would be great, although due to the big effort involved you could wait a little bit more until next version of LiveView with the new Component API is out.
03juan
Thanks for the effort!
That does help keep the memory and data-transfer footprints down when doing
phx-update="prepend"withtemporary_assignssince the list comprehension over posts can just send the deleted post to the relevantPostComponentand all the action sends to the client isOtherwise you’d have to manually update the list stored in memory and remove the list item, or hit the DB to get all fresh posts and send all data again.
So it’s a nice convenience for deleting from a list, but I can’t see the
temporary_assignstechnique working with inserts when ordering is more complex, e.g. alphabetically by name.Also, the idiomatic way to get the meta state is
Ecto.get_meta(post, :state)Morzaram
Hey Juan, thanks for the reply. I think I’ve implemented the delete functionality the way you said, unless I’m missing something. Otherwise, can you send me a snippet of what you mean? I’d really like to make this a best practice thing. I’m also considering making a guide much similar to Rails Guides if I’m able to gather enough resources, and guidance
Thanks for the idiomatic way of doing things, there’s always something new to learn. haha
03juan
Sorry, sometimes I feel I don’t explain things as well as it sounds in my head. Could you elaborate on your confusion?
I think your implementation of delete is correct when using
temporary_assigns.Morzaram
All good! Sometimes my reading comprehension isn’t the best either. You answered my question