import { Subscription } from "./Subscription" ; import { MapLike } from "map-like" ; let version = 0 ; export class SubscriptionGroupByCategoryMap extends MapLike < string , Subscription [ ] > { get version ( ) { return version ; } versionUp ( ) { version = version + 1 ; } sortedEntities ( ) { const sortedKeys = this . keys ( ) . sort ( ) ; return sortedKeys . map ( ( key ) => { const subscriptions = this . get ( key ) as Subscription [ ] ; return [ key , subscriptions ] as [ string , Subscription [ ] ] ; } ) ; } }