{ "version": 3, "sources": ["src/app/core/guards/production-years.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\nimport { Injectable } from '@angular/core';\n\nimport { Observable } from 'rxjs';\nimport { LoadActionGuardFactoryService } from 'src/app/core/services/load-action-guard-factory.service';\nimport { LoadProductionYearsAction } from 'src/app/root-store/global-store/store/actions';\nimport {\n getProductionYearsErred,\n getProductionYearsLoaded\n} from 'src/app/root-store/global-store/store/selectors';\n\n@Injectable()\nexport class ProductionYearsGuard {\n constructor(private _guardFactory: LoadActionGuardFactoryService) {}\n\n canActivate(): Observable {\n return this._guardFactory.canAdvance({\n loadAction: new LoadProductionYearsAction(),\n isLoadedSelector: getProductionYearsLoaded,\n hasErrorSelector: getProductionYearsErred\n });\n }\n}\n"], "mappings": "iHAcA,IAAaA,GAAoB,IAAA,CAA3B,MAAOA,CAAoB,CAC/BC,YAAoBC,EAA4C,CAA5C,KAAAA,cAAAA,CAA+C,CAEnEC,aAAW,CACT,OAAO,KAAKD,cAAcE,WAAW,CACnCC,WAAY,IAAIC,EAChBC,iBAAkBC,EAClBC,iBAAkBC,EACnB,CACH,iDATWV,GAAoBW,EAAAC,CAAA,CAAA,CAAA,CAAA,iCAApBZ,EAAoBa,QAApBb,EAAoBc,SAAA,CAAA,CAAA,SAApBd,CAAoB,GAAA", "names": ["ProductionYearsGuard", "constructor", "_guardFactory", "canActivate", "canAdvance", "loadAction", "LoadProductionYearsAction", "isLoadedSelector", "getProductionYearsLoaded", "hasErrorSelector", "getProductionYearsErred", "\u0275\u0275inject", "LoadActionGuardFactoryService", "factory", "\u0275fac"] }