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

Use LiveView stream for list of items #414

Open
3 tasks
pehbehbeh opened this issue Jun 26, 2024 · 0 comments
Open
3 tasks

Use LiveView stream for list of items #414

pehbehbeh opened this issue Jun 26, 2024 · 0 comments

Comments

@pehbehbeh
Copy link
Member

pehbehbeh commented Jun 26, 2024

Currently, Backpex just assigns the items as a list. It is recommended to use the newish LiveView streams for any kind of collection.

Todos

  • Assign items as a stream
  • Make resource index table work with a stream
  • Properly handle and test events (e.g., item has been created or removed)

Notes

Streams by default for any kind of collection is a good intuition to have. You should use streams any time you don’t want to hold the list of items in memory – which is most times. Streams are also a goto when you want to efficiently update a single list item without refactoring to a layer of LiveComponents for the items.

https://fly.io/phoenix-files/phoenix-dev-blog-streams/

https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#stream/4

@pehbehbeh pehbehbeh added the feature New feature label Jun 26, 2024
@pehbehbeh pehbehbeh moved this to Backlog in Backpex Roadmap Jun 26, 2024
@Flo0807 Flo0807 removed the feature New feature label Feb 15, 2025
@Flo0807 Flo0807 changed the title Streams for list of items Use LiveView stream for list of items Feb 15, 2025
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