runListeners() → {Object}
Factory that sets up the database listeners. Firebase enables real-time updates any time database entries change, and the listeners in this factory get notified. The updated data is then routed to appropriate controllers (e.g. for rendering new user position on the map).
- Source:
Returns:
Returns the factory object ('listener') with all methods to be used by controllers
- Type
- Object
Methods
(static) childAdded()
Listens for new user entries (e.g. when a new user sets up an account and gets added to the database).
- Source:
(static) childChanged()
Listens for updates in any single user data in the database (child_changed). On change, $rootscope broadcasts the event along with the snapshot of the new data that needs to be rendered or updated on the client's screen
- Source:
(static) childRemoved()
Listens for deletions (e.g. when user logs out and their coordinates are removed from the database)
- Source: