Skip to content

Commit

Permalink
feat(migration): export migration type (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcjulian authored and splincode committed Dec 13, 2019
1 parent 9390d1b commit 7dd0eb4
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions src/lib/symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@ import { InjectionToken } from '@angular/core';
import { Observable, of } from 'rxjs';
import { StorageKey } from './internals';

export interface NgxsStoragePluginMigration {
/**
* Version to key off.
*/
version: number | string;

/**
* Method to migrate the previous state.
*/
migrate: (state: any) => any;

/**
* Key to migrate.
*/
key?: string;

/**
* Key for the version. Defaults to 'version'.
*/
versionKey?: string;
}

export interface NgxsStoragePluginOptions {
/**
* Key for the state slice to store in the storage engine.
Expand All @@ -11,27 +33,7 @@ export interface NgxsStoragePluginOptions {
/**
* Migration strategies.
*/
migrations?: {
/**
* Version to key off.
*/
version: number | string;

/**
* Method to migrate the previous state.
*/
migrate: (state: any) => any;

/**
* Key to migrate.
*/
key?: string;

/**
* Key for the version. Defaults to 'version'.
*/
versionKey?: string;
}[];
migrations?: NgxsStoragePluginMigration[];

/**
* Serailizer for the object before its pushed into the engine.
Expand Down

0 comments on commit 7dd0eb4

Please sign in to comment.