Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/basilenouvellet/liveview_cache
Experimental project about adding client caching to Phoenix LiveView
https://github.com/basilenouvellet/liveview_cache
Last synced: about 1 month ago
JSON representation
Experimental project about adding client caching to Phoenix LiveView
- Host: GitHub
- URL: https://github.com/basilenouvellet/liveview_cache
- Owner: basilenouvellet
- License: apache-2.0
- Created: 2023-05-16T17:31:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-16T18:10:10.000Z (over 1 year ago)
- Last Synced: 2024-10-30T00:41:30.203Z (3 months ago)
- Language: Elixir
- Size: 305 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Liveview Cache
This is a **very experimental** project on how to achieve **client caching for LiveView**.
Still in an exploring phase for now, a proper Elixir library could come out of this at some point.
The demo displays a list of the most starred Github repositories, fetched from the Github GraphQL API.
## Next steps
- [x] fetch data from Github
- [ ] cache Github data on the client:
- [ ] cache last socket state in local storage on client
- [ ] send it as params on first socket connection
- [ ] populate liveview assigns with params (during dead render)
- [ ] run benchmarks about loading performance
- [ ] extract an abstraction out of this (LiveView hook? JS hook? just functions?)
- [ ] package it as a proper Elixir library## Setup
- install and setup dependencies: `mix setup`
- start Phoenix endpoint: `iex -S mix phx.server`Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
## Contributing
Contributions are welcome ✌️