fun subscribe(listener: (S) -> Unit): () -> Unit
Subscribes a client for the change state notifications.