https://github.com/karolsluszniak/phoenix_live_controller
Controller-style abstraction for building multi-action live views on top of Phoenix.LiveView
https://github.com/karolsluszniak/phoenix_live_controller
elixir liveview phoenix
Last synced: 3 months ago
JSON representation
Controller-style abstraction for building multi-action live views on top of Phoenix.LiveView
- Host: GitHub
- URL: https://github.com/karolsluszniak/phoenix_live_controller
- Owner: karolsluszniak
- License: mit
- Created: 2020-04-14T14:35:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-25T23:13:20.000Z (over 3 years ago)
- Last Synced: 2024-08-08T21:13:37.057Z (about 1 year ago)
- Topics: elixir, liveview, phoenix
- Language: Elixir
- Homepage: https://hex.pm/packages/phoenix_live_controller
- Size: 96.7 KB
- Stars: 31
- Watchers: 5
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Phoenix LiveController
[](https://github.com/karolsluszniak/phoenix_live_controller/blob/master/LICENSE.md)
[](https://travis-ci.org/karolsluszniak/phoenix_live_controller)
[](https://hex.pm/packages/phoenix_live_controller)**Controller-style abstraction for building multi-action live views on top of Phoenix.LiveView.**
## Installation
Add `phoenix_live_controller` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:phoenix_live_controller, "~> 0.7.0"}
]
end
```## Learning
- [Introductory article & guide for converting HTML resources to live controllers](http://cloudless.studio/articles/51-controller-style-approach-to-liveview-resources) with [example app](https://github.com/karolsluszniak/phoenix_live_controller_example_app)
- [Phoenix.LiveController docs for detailed explanation & examples of live controllers](https://hexdocs.pm/phoenix_live_controller)
- [Phoenix.LiveView docs for explanation of live view itself](https://hexdocs.pm/phoenix_live_view)## Benchmarking
Repository includes a benchmark that allows to measure the worst-case impact of using live controllers with plugs on the web app:
```
$ mix run priv/bench/bench.exs
inline compile: 0.038
inline run: 0.026
plug_atom compile: 0.233
plug_atom run: 0.155
plug_func compile: 0.234
plug_func run: 0.148
```