Related to the question <from Reaktive channel>, I...
# mvikotlin
n
Related to the question from Reaktive channel, I was wondering how websockets work with stores/ what's the recommended way of working with them? Should I just subscribe to everything inside my Executors executeAction? As that's the only place you'll have access to state and dispatch/ publish
a
Hello. You can pass the ChatClient to the
Store
via constructor. Usually permanent subscriptions are done inside the
Bootstrapper
. You can use
subscribeScoped
extension function, so the subscription will be cancelled when the
Store
is disposed.
But it's fine to subscribe in the
Executor
as well, if this is the place where you are doing the initialisation.
n
Thanks for the response on both messages @Arkadii Ivanov
👍 1