liveview-native / liveview-native/liveview-native-core

Support for phx-hook

Open
#124 0 comments 0 reactions 1 assignee View on GitHub

@simlay is already working on this.

Since Jun 24, 2024.

parity
Dominant language
Rust
Stars
166
Forks
14
PR merge metrics
No merged PRs in 30d

Description

LiveView uses [`phx-hook`](https://hexdocs.pm/phoenix_live_view/js-interop.html#client-hooks-via-phx-hook) to support custom client-side events. In Phoenix LiveView, a hook is added to a [`LiveSocket` in the `opts: {}`](https://github.com/phoenixframework/phoenix_live_view/blob/88a3ebc72287775170180523bb5b39af95f25278/assets/js/phoenix_live_view/live_socket.js#L150). The [built in hooks are `LiveFileUpload` and `InfiniteScroll`](https://github.com/phoenixframework/phoenix_live_view/blob/88a3ebc72287775170180523bb5b39af95f25278/assets/js/phoenix_live_view/hooks.js).

Core currently [has `LiveChannel` and `LiveSocket`](https://github.com/liveview-native/liveview-native-core/blob/f002483f5112a0d3a2fe15c055237b805fc47bc4/crates/core/src/live_socket/mod.rs#L18-L34) which I've tried to make akin to LiveView's `LiveSocket`. Client side hooks should be added to liveview-native-core and exposed a reasonable way to add hook events to the clients.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.