Browse Source

Code modularization

main
Cédric Belin 7 months ago
parent
commit
58bf9b06cb
3 changed files with 27 additions and 1 deletions
  1. +3
    -1
      src/index.ts
  2. +12
    -0
      src/local_storage.ts
  3. +12
    -0
      src/session_storage.ts

+ 3
- 1
src/index.ts View File

@ -1 +1,3 @@
export * from "./storage";
export * from "./local_storage";
export * from "./session_storage";
export * from "./web_storage";

+ 12
- 0
src/local_storage.ts View File

@ -0,0 +1,12 @@
import {Injectable} from "@angular/core";
import {WebStorage} from "./web_storage";
/** Provides access to the local storage. */
@Injectable({providedIn: "root"})
export class LocalStorage extends WebStorage {
/** Creates a new storage service. */
constructor() {
super(localStorage);
}
}

+ 12
- 0
src/session_storage.ts View File

@ -0,0 +1,12 @@
import {Injectable} from "@angular/core";
import {WebStorage} from "./web_storage";
/** Provides access to the session storage. */
@Injectable({providedIn: "root"})
export class SessionStorage extends WebStorage {
/** Creates a new storage service. */
constructor() {
super(sessionStorage);
}
}

Loading…
Cancel
Save