I guess my concern there is if I return the whole state to the library user to store in e.g. the application-local atom, then it becomes really non-trivial to manage bits of that state transparently within the library (e.g. reacting to the websocket closure and transparently reconnecting, without having it handled by the external API). Insofar I found it reasonably easy to just internalize the library state in an atom within the library's own namespace, but that, of course, limits the RPC client to exactly one "instance".