Skip to content
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

Learn Liveview #223

Open
ndrean opened this issue Oct 16, 2024 · 2 comments
Open

Learn Liveview #223

ndrean opened this issue Oct 16, 2024 · 2 comments

Comments

@ndrean
Copy link
Contributor

ndrean commented Oct 16, 2024

I am adding a link to a site that - upon me - explains LiveView very nicely.
The best I've seen so far. Worth reading and keeping.

https://adopt-liveview.lubien.dev/

For example, it explains clearly how to use these "slots" in functional components.

The GitHub repo shows also how to:

Maybe only missing "advanced" concepts like streams and async assigns.

For the async assigns with slots, I recommend to check this repo.
It is a companion to this video: https://www.youtube.com/watch?v=FF9lSxeQkwA
In this video, we does a simple async task is to generate a typst file from your data and render it. It is a nice printable document that you can download and print.

@nelsonic
Copy link
Member

at present the https://adopt-liveview.lubien.dev is only a beginners level: 🔰
image
But it looks good/promising! 😍

@MikeRund you have followed the Adopt LiveView course and made loads of notes in your (paper) notebook. 📝
Please see: #226

@ndrean
Copy link
Contributor Author

ndrean commented Oct 31, 2024

What took me a bit of time to understand is these two points in Elixir:

  • async does not exists
  • and how do you keep long running tasks, since it is just running functions that die on completion?

The response is that a long term running process is just calling itself. Then you can keep some state. GenServers are mostly this.

Then running something async is just spwaning another process in fact. It can be blocking if you "await", but mostly you want to use the wrapper Task. The beauty is that each process has a mailbox and referenced by its PID. So all you are doing is sending messages to mailboxes identified by PIDs.

Of course you have more than that with OTP. You have ETS and PubSub and more primitives for free (not even talking of distribution).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants