Skip to content

init doesn't run on page reload #125

@bahalperin

Description

@bahalperin

Short version: is there a way to get a Msg to fire when the page loads?

This might just be me misunderstanding how things are meant to work rather than a real issue.

I expected that if I refreshed the page, init would run again and I'd get my app into a fresh state. Here's a specific example of something I'm running to that feels odd to me. I'm exploring the language and building a simple slack clone. While developing, I'm logged in as two different users in two different tabs. User 1 creates a new channel but I forgot to add a pubsub message so it never appears in the UI of user 2. I'd expect to be able to reload the page for user 2 to get the new channel, but it seems like there's no message to hook into to do that.

I can think of some hacky ways to get this to work but wondering if there's something built in that I'm missing. Thanks!

Also, is there a better place to ask questions like this rather than creating an issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions