TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Phoenix LiveView: Async Assign Pattern

146 pointsby gnutrinoalmost 2 years ago

5 comments

gnutrinoalmost 2 years ago
I started using this pattern in my LiveView projects, and finally rolled it into a common module for others to use. I&#x27;ve found it really helps clean up the mount function, which can get pretty messy as your LiveViews grow over time.<p>My apologies for the terrible elixir syntax highlighting in this post. I keep putting off finding a good way to do this on Blogger.
评论 #36332761 未加载
vinnymacalmost 2 years ago
I haven&#x27;t written Elixir professionally the last couple of years, but I was an early user of LiveView when it was first demoed at a conference.<p>As someone who currently writes applications using React Server Components, I am interested to see how concepts like LiveView evolve over time. We are now shipping significantly more HTML than before, and a lot less Javascript, as more has been moved to the server.<p>Makes me wish LiveView was portable to every other platform I work on, rather than having to convince companies to write more Elixir (although that isn&#x27;t a bad thing).
评论 #36333026 未加载
评论 #36334766 未加载
评论 #36331820 未加载
评论 #36334078 未加载
ramchipalmost 2 years ago
Does this work well with tests? For instance, if you click a button in a test, do you need to do something special to ensure the async update has happened before checking assertions on the HTML contents?
评论 #36335285 未加载
tommicaalmost 2 years ago
Looks really useful and neat especially the way it chains so fluently for parallerization
评论 #36332092 未加载
wahnfriedenalmost 2 years ago
Anyone doing similar with Swift given it also has server continuations?