{ "version": 3, "sources": ["src/app/core/guards/notifications-socket-connection.guard.ts", "src/app/core/guards/notifications.guard.ts"], "sourcesContent": ["// why use a route guard instead of a resolve?\n// a. we don't need a resolve because we are using a store\n// b. it gives us a benefit of controlling navigation to navigate away, etc\n\nimport { Injectable } from '@angular/core';\n\nimport { Observable } from 'rxjs';\nimport {\n getNotificationsSocketInitialized,\n getNotificationsSocketErred\n} from 'src/app/root-store/global-store/store/selectors';\nimport { InitializeNotificationsSocketConnection } from 'src/app/root-store/global-store/store/actions';\nimport { LoadActionGuardFactoryService } from 'src/app/core/services/load-action-guard-factory.service';\n\n@Injectable()\nexport class NotificationsSocketConnectionGuard {\n constructor(private _guardFactory: LoadActionGuardFactoryService) {}\n\n canActivate(): Observable {\n return this._guardFactory.canAdvance({\n loadAction: new InitializeNotificationsSocketConnection(),\n isLoadedSelector: getNotificationsSocketInitialized,\n hasErrorSelector: getNotificationsSocketErred,\n isBlocking: false // non-blocking\n });\n }\n}\n", "// why use a route guard instead of a resolve?\n// a. we don't need a resolve because we are using a store\n// b. it gives us a benefit of controlling navigation to navigate away, etc\nimport { Injectable } from '@angular/core';\n\nimport { Observable } from 'rxjs';\nimport { LoadActionGuardFactoryService } from 'src/app/core/services/load-action-guard-factory.service';\nimport { LoadNotifications } from 'src/app/root-store/global-store/store/actions';\nimport {\n getNotificationsErred,\n getNotificationsLoaded\n} from 'src/app/root-store/global-store/store/selectors';\n\n@Injectable()\nexport class NotificationsGuard {\n constructor(private _guardFactory: LoadActionGuardFactoryService) {}\n\n canActivate(): Observable {\n return this._guardFactory.canAdvance({\n loadAction: new LoadNotifications(),\n isLoadedSelector: getNotificationsLoaded,\n hasErrorSelector: getNotificationsErred,\n isBlocking: false // non-blocking\n });\n }\n}\n"], "mappings": "yIAeA,IAAaA,GAAkC,IAAA,CAAzC,MAAOA,CAAkC,CAC7CC,YAAoBC,EAA4C,CAA5C,KAAAA,cAAAA,CAA+C,CAEnEC,aAAW,CACT,OAAO,KAAKD,cAAcE,WAAW,CACnCC,WAAY,IAAIC,EAChBC,iBAAkBC,EAClBC,iBAAkBC,EAClBC,WAAY,GACb,CACH,iDAVWX,GAAkCY,EAAAC,CAAA,CAAA,CAAA,CAAA,iCAAlCb,EAAkCc,QAAlCd,EAAkCe,SAAA,CAAA,CAAA,SAAlCf,CAAkC,GAAA,ECD/C,IAAagB,GAAkB,IAAA,CAAzB,MAAOA,CAAkB,CAC7BC,YAAoBC,EAA4C,CAA5C,KAAAA,cAAAA,CAA+C,CAEnEC,aAAW,CACT,OAAO,KAAKD,cAAcE,WAAW,CACnCC,WAAY,IAAIC,EAChBC,iBAAkBC,EAClBC,iBAAkBC,EAClBC,WAAY,GACb,CACH,iDAVWX,GAAkBY,EAAAC,CAAA,CAAA,CAAA,CAAA,iCAAlBb,EAAkBc,QAAlBd,EAAkBe,SAAA,CAAA,CAAA,SAAlBf,CAAkB,GAAA", "names": ["NotificationsSocketConnectionGuard", "constructor", "_guardFactory", "canActivate", "canAdvance", "loadAction", "InitializeNotificationsSocketConnection", "isLoadedSelector", "getNotificationsSocketInitialized", "hasErrorSelector", "getNotificationsSocketErred", "isBlocking", "\u0275\u0275inject", "LoadActionGuardFactoryService", "factory", "\u0275fac", "NotificationsGuard", "constructor", "_guardFactory", "canActivate", "canAdvance", "loadAction", "LoadNotifications", "isLoadedSelector", "getNotificationsLoaded", "hasErrorSelector", "getNotificationsErred", "isBlocking", "\u0275\u0275inject", "LoadActionGuardFactoryService", "factory", "\u0275fac"] }