Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Latest commit

 

History

History
66 lines (49 loc) · 1.52 KB

MIGRATING.md

File metadata and controls

66 lines (49 loc) · 1.52 KB

6.0.0

The following can be handled by ng update:

  • NgForageModule has been removed. provide DEFAULT_CONFIG instead if you were using forRoot:
import {DEFAULT_CONFIG, NgForageOptions} from 'ngforage';

@NgModule({
  providers: [
    {
      provide: DEFAULT_CONFIG,
      useValue: {
        name: 'foo',
        cacheTime: 300000
      } as NgForageOptions
    }
  ]
})
export class AppModule {}

5.0.0

No migration steps needed

4.0.0

sessionStorage support

sessionStorage support was dropped from ngforage. If you require sessionStorage you can use the localforage-driver-session-storage package and define the driver in either localforage or ngforage.

Driver name constants have moved

Driver name constants were previously part of the NgForageConfig class. They have now been moved to their own separate enum:

import {Driver, NgForage} from 'ngforage';

class MyService {
  public constructor(ngf: NgForage) {
    ngf.configure({
      driver: [
        Driver.INDEXED_DB,
        Driver.LOCAL_STORAGE
      ]
    })
  }
}