GreenAsh.OnMount (GreenAsh v0.3.0)

Copy Markdown View Source

on_mount set by the router macro: injects into each LiveView the list of domains, the mount base, the current tenant, and the current actor (resolved from the session, within that tenant).

When an actor is stored in the session but cannot be loaded, actor is nil and actor_notice carries the reason for the screen to display — see GreenAsh.Actor.resolve/2.

Without an explicit domains: passed to the macro, the list is read on every request from Application.get_env(otp_app, :ash_domains, []) — a domain added afterward (via the Ash generators, which already maintain this config) therefore appears immediately, with no reinstallation needed.

Summary

Functions

on_mount(atom, params, session, socket)