This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copy and paste the one you need | |
// Check current registration | |
navigator.serviceWorker.getRegistration() | |
.then(registration => console.log('Registration : ', registration)); | |
// Cancel current registation | |
navigator.serviceWorker.getRegistration() | |
.then(async (registration)=>{ | |
if (!registration){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {ActionReducer, Action} from '@ngrx/store'; | |
import {merge, pick} from 'lodash-es'; | |
function setSavedState(state: any, localStorageKey: string) { | |
localStorage.setItem(localStorageKey, JSON.stringify(state)); | |
} | |
function getSavedState(localStorageKey: string): any { | |
return JSON.parse(localStorage.getItem(localStorageKey)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
trigger, | |
state, | |
style, | |
animate, | |
transition | |
} from '@angular/animations'; | |
import { AnimationEntryMetadata } from "@angular/core"; |