How to use @ng-idle/keepalive - 3 common examples

To help you get started, we’ve selected a few @ng-idle/keepalive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tmobile / jazz / core / jazz_ui / src / app / app.module.ts View on Github external
declarations: [
    AppComponent,
    LandingComponent,
    Error404Component,
    TestApiComponent,
    UserJourneyComponent
  ],
  imports: [
    
    BrowserModule,
    FormsModule,
    DropdownModule,
    HttpModule,
    ToasterModule,
    RouterModule.forRoot(routes),
    NgIdleKeepaliveModule.forRoot(),
    SharedModule,
  ],
  providers: [
    AuthenticationService,
    CronParserService,
    SharedService,
    RouteGuard,
    DataCacheService,
    RequestService,
    MessageService,
    ConfigService,
    UtilsService,
    {
      provide: APP_INITIALIZER,
      useFactory: ConfigLoader,
      deps: [ConfigService],
github NationalBankBelgium / stark / packages / stark-core / src / modules / session / session.module.ts View on Github external
import { NgIdleModule } from "@ng-idle/core";
import { NgIdleKeepaliveModule } from "@ng-idle/keepalive";
import { from } from "rxjs";
import { starkSessionReducers } from "./reducers";
import { STARK_SESSION_CONFIG, StarkSessionConfig } from "./entities";
import { STARK_SESSION_SERVICE, StarkSessionServiceImpl } from "./services";
import { STARK_ROUTING_SERVICE, StarkRoutingService } from "../routing/services";
import { SESSION_STATES } from "./routes";
import { starkLoginStateName, starkPreloadingStateName } from "./constants";
import { StarkAppContainerComponent } from "./components";

@NgModule({
	imports: [
		CommonModule,
		NgIdleModule.forRoot(),
		NgIdleKeepaliveModule.forRoot(),
		StoreModule.forFeature("StarkSession", starkSessionReducers),
		UIRouterModule.forChild({
			states: SESSION_STATES
		})
	],
	declarations: [StarkAppContainerComponent],
	exports: [StarkAppContainerComponent]
})
export class StarkSessionModule {
	/**
	 * Instantiates the services only once since they should be singletons
	 * so the forRoot() should be called only by the AppModule
	 * @link https://angular.io/guide/singleton-services#forroot
	 * @param sessionConfig - Object containing the configuration (if any) for the Session service
	 * @returns a module with providers
	 */
github bwsw / cloudstack-ui / src / app / app.module.ts View on Github external
DragulaModule,
    AuthModule,
    EventsModule,
    ScrollingModule,
    SecurityGroupModule,
    ServiceOfferingModule,
    SettingsModule,
    SnapshotModule,
    VolumeModule,
    SshKeysModule,
    VmLogsModule,
    TemplateModule,
    VmModule,
    AccountModule,
    ResourceQuotasModule,
    NgIdleKeepaliveModule.forRoot(),
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient],
      },
    }),
  ],
  declarations: [AppComponent, HomeComponent],
  providers: [
    {
      provide: APP_INITIALIZER,
      useFactory: InitAppFactory,
      deps: [AuthService, HttpClient, TranslateService, Store],
      multi: true,
    },

@ng-idle/keepalive

Module that works with @ng-idle/core to keep a user session alive while user is active.

Apache-2.0
Latest version published 3 months ago

Package Health Score

78 / 100
Full package analysis

Popular @ng-idle/keepalive functions