DEV Community

Discussion on: Using Vue Composition API with Firebase

 
paulvanbladel profile image
paul van bladel

completely valid point, the event registration should be executed only once in the app. also the state should be kept outside the hook function, in such a way it is shared over components initiating the hook.
The way how the state is exposed now makes the state mutable outside the hook function. If the state is exposed as a computed, it becomes unmutable, that's cleaner.