-
Notifications
You must be signed in to change notification settings - Fork 893
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
Allow client-side values to be sent to a LiveView #204
Comments
Is this the same as sending custom events from users' javascript? I am using something like this, although pretty sure I'm abusing private API and it's not entirely nice:
which then triggers appropriate clause in handle_info in LiveView. Are we talking here about wrapping this up in a nicer public interface? |
That would be one aspect of it. Another aspect is sending connection params to the socket like we already can with a normal channels socket but for a LiveSocket. Some values are only available from the browser like locale and timezone information so we need some way of passing it down to a LiveView.
|
I'm running into this need too. Maybe another thing to consider: do we open up things like browser local storage to LiveView? |
Closed via #239 You can now do: let liveSocket = new LiveSocket("/live", {logger: logger, params: {foo: "bar"}}) and then they will be available during connected mount via |
As discussed with @chrismccord in Slack, we need a way to pass client-side values to a LiveView. An example use-case is being able to send in timezone information coming from the browser on socket connect.
The text was updated successfully, but these errors were encountered: