Is there any way to register handlers for session ...
# support-questions-legacy
w
Is there any way to register handlers for session events later in the application lifecycle on the front as opposed to in
Session.init
?
I'd like to set up a subscription later in the application lifecycle where I have access to some React Context
r
w
No, I was hoping to be able to register them much later. Session.init needs to happen basically at the entrypoint to the application. I'd like to be able to register some listeners only if the user accesses a specific part of the app
@rp_st If this doesn't exist now would you be open to accepting some open source contributions to add it? I think it would be extremely useful for people to be able to add event listeners later and not require them to be registered inside of Session.init
r
> I'd like to be able to register some listeners only if the user accesses a specific part of the app You could add listeners on init, and then "activate" then only when you want to. Effecitvely, it would be the same thing
sort of like you could add your own event firing on top of ours, and add listeners to your event firing only when you want to
w
Yeah I could definitely hack something together using that approach. Its just a little odd because I'll have to store the handlers in some global place so I can access them later instead of just being able to subscribe in the place where it makes the most sense. No worries though if you'd rather not modify the API surface I can go with this approach