Skip to content

Instantly share code, notes, and snippets.

@splincode
Last active May 17, 2020 18:55
Show Gist options
  • Save splincode/ccb29f8bc573455a9477c36ab63adfc0 to your computer and use it in GitHub Desktop.
Save splincode/ccb29f8bc573455a9477c36ab63adfc0 to your computer and use it in GitHub Desktop.
// novels.state.ts
@Persistence({
existingEngine: sessionStorage
})
@State<Novel[]>({
name: 'novels',
defaults: []
})
@Injectable()
export class NovelsState {}
// detectives.state.ts
@Persistence() // localStorage by default in existingEngine
@State<Detective[]>({
name: 'detectives',
defaults: []
})
@Injectable()
export class DetectivesState {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment