Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 931 Bytes

COLLISION_BEFORE_V8.md

File metadata and controls

29 lines (21 loc) · 931 Bytes

Collision guide (outdated)

localStorage and IndexedDB are restricted to the same subdomain, so no risk of collision in most cases. Only if you have multiple apps on the same subdomain and you don't want to share data between them, you need to add a prefix.

Version

This is an outdated guide about collision in versions < 8 of this lib. The up to date guide about collision for versions >= 8 is available here.

Configuration

import { localStorageProviders } from '@ngx-pwa/local-storage';

@NgModule({
  providers: [
    localStorageProviders({ prefix: 'myapp' })
  ]
})
export class AppModule {}

Note:

  • it is an initialization step, so as mentioned in the example, it must be done in AppModule,
  • never change this option in an app already deployed in production, as all previously stored data would be lost.

Back to general documentation