Commit 82d434df authored by Robert Knight's avatar Robert Knight

Convert `groups` service to an ES class

 - Convert the `groups` service to an ES class and the many closures in
   the constructor to private or public methods.

 - Remove the unused `all` and `get` methods of the groups service.
   These were trivial wrappers around store methods. UI components
   should use the store methods directly.
parent 87956ee3
......@@ -16,7 +16,7 @@ import MenuItem from '../MenuItem';
* @prop {boolean} [isExpanded] - Whether the submenu for this group is expanded
* @prop {(expand: boolean) => any} onExpand -
* Callback invoked to expand or collapse the current group
* @prop {Object} groups - Injected service
* @prop {import('../../services/groups').GroupsService} groups
* @prop {import('../../services/toast-messenger').ToastMessengerService} toastMessenger
*/
......
......@@ -113,7 +113,7 @@ import { AuthService } from './services/auth';
import { AutosaveService } from './services/autosave';
import { FeaturesService } from './services/features';
import { FrameSyncService } from './services/frame-sync';
import groupsService from './services/groups';
import { GroupsService } from './services/groups';
import { LoadAnnotationsService } from './services/load-annotations';
import { LocalStorageService } from './services/local-storage';
import { PersistedDefaultsService } from './services/persisted-defaults';
......@@ -151,7 +151,7 @@ function startApp(config, appEl) {
.register('bridge', bridgeService)
.register('features', FeaturesService)
.register('frameSync', FrameSyncService)
.register('groups', groupsService)
.register('groups', GroupsService)
.register('loadAnnotationsService', LoadAnnotationsService)
.register('localStorage', LocalStorageService)
.register('persistedDefaults', PersistedDefaultsService)
......
This diff is collapsed.
......@@ -12,7 +12,7 @@ import { watch } from '../util/watch';
*
* @param {import('../store').SidebarStore} store
* @param {import('./auth').AuthService} auth
* @param {ReturnType<import('./groups').default>} groups
* @param {import('./groups').GroupsService} groups
* @param {import('./session').SessionService} session
* @param {Record<string, any>} settings
*/
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment