diff --git a/README.md b/README.md index 2af3f77..8d8daee 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ management using Redux. [![downloads per month](https://img.shields.io/npm/dm/@angular-redux2/undo.svg)](https://www.npmjs.com/package/@angular-redux2/undo) ## Installation + You can install angular-redux2/sync using npm: ```bash @@ -15,11 +16,13 @@ npm install @angular-redux2/undo ``` ## Usage -- Take me to the [API docs](https://angular-redux2.github.io/undo). + +> Take me to the [API docs](https://angular-redux2.github.io/undo). To use `@angular-redux2/undo` in your Angular application, follow these steps: Define a StateWatchMap object that maps the properties you want to track for undo/redo operations to their corresponding -state paths and configure the undo middleware in your Angular-Redux2/store setup by including it in the list of middleware: +state paths and configure the undo middleware in your Angular-Redux2/store setup by including it in the list of +middleware: ```typescript const middleware: Array = [ @@ -28,15 +31,26 @@ const middleware: Array = [ path: 'path.to.property1' }, propertyName2: { - path: 'path.to.property2' + path: 'path.to.property2', + limit: 5 }, }), ]; ngRedux.configureStore(rootReducer, {}, middleware, enhancer); ``` + +settings: + +- `path` (required): The path to the property in the state object using dot notation. +- `filter` (optional): A filter function that determines if the property should be watched for undo/redo. Return true to + include the property, and false to exclude it. If not specified, all properties are included. +- `limit` (optional): The maximum number of past snapshots to keep in the undo history. If the limit is reached, the + oldest snapshots are discarded. If not specified, no limit is applied. + Implement the undo/redo functionality in your Angular component or service. -You can use the `undo`, `redo`, `jump`, and `clear_history` methods provided by `NgUndoStateActions` to perform the corresponding actions: +You can use the `undo`, `redo`, `jump`, and `clear_history` methods provided by `NgUndoStateActions` to perform the +corresponding actions: ```typescript // Example component @@ -54,7 +68,8 @@ import { undo, redo, jump, clear_history } from '@angular-redux2/undo'; ` }) export class ExampleComponent { - constructor(private undoStateActions: NgUndoStateActions) {} + constructor(private undoStateActions: NgUndoStateActions) { + } @Dispatch onUndo() { @@ -77,3 +92,47 @@ export class ExampleComponent { } } ``` + +## State Watch Map + +The state watch map is an object that defines the paths to the state properties you want to track for undo. It has the +following structure: + +```typescript +export interface StateWatchMap { + [key: string]: { + path: string; + filter?: (action: any, currentState: any, snapshot: any) => boolean; + limit?: number; + } +} +``` + +- `key` (string): The unique identifier for the state property. +- `path` (string): The dot-separated path to the state property. +- `filter` (optional function): A filter function that determines if an action should be captured in the undo history + for the specific state property. + +## Custom Filters + +You can define custom filter functions to control which actions are captured in the undo history for each state +property. +The filter function takes three parameters: + +- `action`: The dispatched action object. +- `currentState`: The current store state object. +- `snapshot`: The snapshot to insert into the history. + +The filter function should return true if the action should be captured, or false otherwise. +Here's an example of a custom filter function that only captures actions with specific types: + +```typescript +const stateWatchMap: StateWatchMap = { + 'todos': { + path: 'todos', + filter: (action: any, currentState: any, snapshot: any): boolean => { + return action.type === 'ADD_TODO' || action.type === 'REMOVE_TODO'; + } + } +}; +``` diff --git a/docs/assets/search.js b/docs/assets/search.js index fd67584..ddc7ae9 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"rows\":[{\"kind\":64,\"name\":\"ngUndoMiddleware\",\"url\":\"functions/ngUndoMiddleware.html\",\"classes\":\"\"},{\"kind\":128,\"name\":\"UndoService\",\"url\":\"classes/UndoService.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/UndoService.html#constructor\",\"classes\":\"\",\"parent\":\"UndoService\"},{\"kind\":1024,\"name\":\"watchStateMap\",\"url\":\"classes/UndoService.html#watchStateMap\",\"classes\":\"tsd-is-protected\",\"parent\":\"UndoService\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"classes/UndoService.html#watchStateMap.__type\",\"classes\":\"\",\"parent\":\"UndoService.watchStateMap\"},{\"kind\":2048,\"name\":\"watcherState\",\"url\":\"classes/UndoService.html#watcherState\",\"classes\":\"\",\"parent\":\"UndoService\"},{\"kind\":2048,\"name\":\"watcherAction\",\"url\":\"classes/UndoService.html#watcherAction\",\"classes\":\"tsd-is-protected\",\"parent\":\"UndoService\"},{\"kind\":2048,\"name\":\"detectChange\",\"url\":\"classes/UndoService.html#detectChange\",\"classes\":\"tsd-is-protected\",\"parent\":\"UndoService\"},{\"kind\":32,\"name\":\"HISTORY_STATE_KEY\",\"url\":\"variables/HISTORY_STATE_KEY.html\",\"classes\":\"\"},{\"kind\":32,\"name\":\"UNDO_REDUCER_PREFIX\",\"url\":\"variables/UNDO_REDUCER_PREFIX.html\",\"classes\":\"\"},{\"kind\":8,\"name\":\"UndoActions\",\"url\":\"enums/UndoActions.html\",\"classes\":\"\"},{\"kind\":16,\"name\":\"UNDO\",\"url\":\"enums/UndoActions.html#UNDO\",\"classes\":\"\",\"parent\":\"UndoActions\"},{\"kind\":16,\"name\":\"REDO\",\"url\":\"enums/UndoActions.html#REDO\",\"classes\":\"\",\"parent\":\"UndoActions\"},{\"kind\":16,\"name\":\"JUMP\",\"url\":\"enums/UndoActions.html#JUMP\",\"classes\":\"\",\"parent\":\"UndoActions\"},{\"kind\":16,\"name\":\"CLEAR_HISTORY\",\"url\":\"enums/UndoActions.html#CLEAR_HISTORY\",\"classes\":\"\",\"parent\":\"UndoActions\"},{\"kind\":256,\"name\":\"UndoState\",\"url\":\"interfaces/UndoState.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"past\",\"url\":\"interfaces/UndoState.html#past\",\"classes\":\"\",\"parent\":\"UndoState\"},{\"kind\":1024,\"name\":\"future\",\"url\":\"interfaces/UndoState.html#future\",\"classes\":\"\",\"parent\":\"UndoState\"},{\"kind\":256,\"name\":\"NgUndoState\",\"url\":\"interfaces/NgUndoState.html\",\"classes\":\"\"},{\"kind\":256,\"name\":\"NgUndoAction\",\"url\":\"interfaces/NgUndoAction.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"type\",\"url\":\"interfaces/NgUndoAction.html#type-1\",\"classes\":\"\",\"parent\":\"NgUndoAction\"},{\"kind\":1024,\"name\":\"payload\",\"url\":\"interfaces/NgUndoAction.html#payload\",\"classes\":\"\",\"parent\":\"NgUndoAction\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/NgUndoAction.html#payload.__type\",\"classes\":\"\",\"parent\":\"NgUndoAction.payload\"},{\"kind\":1024,\"name\":\"type\",\"url\":\"interfaces/NgUndoAction.html#payload.__type.type\",\"classes\":\"\",\"parent\":\"NgUndoAction.payload.__type\"},{\"kind\":1024,\"name\":\"propertyName\",\"url\":\"interfaces/NgUndoAction.html#payload.__type.propertyName\",\"classes\":\"\",\"parent\":\"NgUndoAction.payload.__type\"},{\"kind\":1024,\"name\":\"index\",\"url\":\"interfaces/NgUndoAction.html#payload.__type.index\",\"classes\":\"\",\"parent\":\"NgUndoAction.payload.__type\"},{\"kind\":256,\"name\":\"StateWatchMap\",\"url\":\"interfaces/StateWatchMap.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/StateWatchMap.html#__index.__type\",\"classes\":\"\",\"parent\":\"StateWatchMap.__index\"},{\"kind\":1024,\"name\":\"path\",\"url\":\"interfaces/StateWatchMap.html#__index.__type.path\",\"classes\":\"\",\"parent\":\"StateWatchMap.__index.__type\"},{\"kind\":64,\"name\":\"undo\",\"url\":\"functions/undo.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"redo\",\"url\":\"functions/redo.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"clearHistory\",\"url\":\"functions/clearHistory.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"jump\",\"url\":\"functions/jump.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"ngUndoState\",\"url\":\"functions/ngUndoState-1.html\",\"classes\":\"\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,31.499]],[\"comment/0\",[]],[\"name/1\",[1,31.499]],[\"comment/1\",[]],[\"name/2\",[2,31.499]],[\"comment/2\",[]],[\"name/3\",[3,31.499]],[\"comment/3\",[]],[\"name/4\",[4,23.026]],[\"comment/4\",[]],[\"name/5\",[5,31.499]],[\"comment/5\",[]],[\"name/6\",[6,31.499]],[\"comment/6\",[]],[\"name/7\",[7,31.499]],[\"comment/7\",[]],[\"name/8\",[8,31.499]],[\"comment/8\",[]],[\"name/9\",[9,31.499]],[\"comment/9\",[]],[\"name/10\",[10,31.499]],[\"comment/10\",[]],[\"name/11\",[11,26.391]],[\"comment/11\",[]],[\"name/12\",[12,26.391]],[\"comment/12\",[]],[\"name/13\",[13,26.391]],[\"comment/13\",[]],[\"name/14\",[14,31.499]],[\"comment/14\",[]],[\"name/15\",[15,31.499]],[\"comment/15\",[]],[\"name/16\",[16,31.499]],[\"comment/16\",[]],[\"name/17\",[17,31.499]],[\"comment/17\",[]],[\"name/18\",[18,26.391]],[\"comment/18\",[]],[\"name/19\",[19,31.499]],[\"comment/19\",[]],[\"name/20\",[20,26.391]],[\"comment/20\",[]],[\"name/21\",[21,31.499]],[\"comment/21\",[]],[\"name/22\",[4,23.026]],[\"comment/22\",[]],[\"name/23\",[20,26.391]],[\"comment/23\",[]],[\"name/24\",[22,31.499]],[\"comment/24\",[]],[\"name/25\",[23,31.499]],[\"comment/25\",[]],[\"name/26\",[24,31.499]],[\"comment/26\",[]],[\"name/27\",[4,23.026]],[\"comment/27\",[]],[\"name/28\",[25,31.499]],[\"comment/28\",[]],[\"name/29\",[11,26.391]],[\"comment/29\",[]],[\"name/30\",[12,26.391]],[\"comment/30\",[]],[\"name/31\",[26,31.499]],[\"comment/31\",[]],[\"name/32\",[13,26.391]],[\"comment/32\",[]],[\"name/33\",[18,26.391]],[\"comment/33\",[]]],\"invertedIndex\":[[\"__type\",{\"_index\":4,\"name\":{\"4\":{},\"22\":{},\"27\":{}},\"comment\":{}}],[\"clear_history\",{\"_index\":14,\"name\":{\"14\":{}},\"comment\":{}}],[\"clearhistory\",{\"_index\":26,\"name\":{\"31\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"detectchange\",{\"_index\":7,\"name\":{\"7\":{}},\"comment\":{}}],[\"future\",{\"_index\":17,\"name\":{\"17\":{}},\"comment\":{}}],[\"history_state_key\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"index\",{\"_index\":23,\"name\":{\"25\":{}},\"comment\":{}}],[\"jump\",{\"_index\":13,\"name\":{\"13\":{},\"32\":{}},\"comment\":{}}],[\"ngundoaction\",{\"_index\":19,\"name\":{\"19\":{}},\"comment\":{}}],[\"ngundomiddleware\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"ngundostate\",{\"_index\":18,\"name\":{\"18\":{},\"33\":{}},\"comment\":{}}],[\"past\",{\"_index\":16,\"name\":{\"16\":{}},\"comment\":{}}],[\"path\",{\"_index\":25,\"name\":{\"28\":{}},\"comment\":{}}],[\"payload\",{\"_index\":21,\"name\":{\"21\":{}},\"comment\":{}}],[\"propertyname\",{\"_index\":22,\"name\":{\"24\":{}},\"comment\":{}}],[\"redo\",{\"_index\":12,\"name\":{\"12\":{},\"30\":{}},\"comment\":{}}],[\"statewatchmap\",{\"_index\":24,\"name\":{\"26\":{}},\"comment\":{}}],[\"type\",{\"_index\":20,\"name\":{\"20\":{},\"23\":{}},\"comment\":{}}],[\"undo\",{\"_index\":11,\"name\":{\"11\":{},\"29\":{}},\"comment\":{}}],[\"undo_reducer_prefix\",{\"_index\":9,\"name\":{\"9\":{}},\"comment\":{}}],[\"undoactions\",{\"_index\":10,\"name\":{\"10\":{}},\"comment\":{}}],[\"undoservice\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"undostate\",{\"_index\":15,\"name\":{\"15\":{}},\"comment\":{}}],[\"watcheraction\",{\"_index\":6,\"name\":{\"6\":{}},\"comment\":{}}],[\"watcherstate\",{\"_index\":5,\"name\":{\"5\":{}},\"comment\":{}}],[\"watchstatemap\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = JSON.parse("{\"rows\":[{\"kind\":64,\"name\":\"ngUndoMiddleware\",\"url\":\"functions/ngUndoMiddleware.html\",\"classes\":\"\"},{\"kind\":128,\"name\":\"UndoService\",\"url\":\"classes/UndoService.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/UndoService.html#constructor\",\"classes\":\"\",\"parent\":\"UndoService\"},{\"kind\":1024,\"name\":\"watchStateMap\",\"url\":\"classes/UndoService.html#watchStateMap\",\"classes\":\"tsd-is-protected\",\"parent\":\"UndoService\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"classes/UndoService.html#watchStateMap.__type\",\"classes\":\"\",\"parent\":\"UndoService.watchStateMap\"},{\"kind\":2048,\"name\":\"watcherState\",\"url\":\"classes/UndoService.html#watcherState\",\"classes\":\"\",\"parent\":\"UndoService\"},{\"kind\":2048,\"name\":\"watcherAction\",\"url\":\"classes/UndoService.html#watcherAction\",\"classes\":\"tsd-is-protected\",\"parent\":\"UndoService\"},{\"kind\":2048,\"name\":\"detectChange\",\"url\":\"classes/UndoService.html#detectChange\",\"classes\":\"tsd-is-protected\",\"parent\":\"UndoService\"},{\"kind\":32,\"name\":\"HISTORY_STATE_KEY\",\"url\":\"variables/HISTORY_STATE_KEY.html\",\"classes\":\"\"},{\"kind\":32,\"name\":\"UNDO_REDUCER_PREFIX\",\"url\":\"variables/UNDO_REDUCER_PREFIX.html\",\"classes\":\"\"},{\"kind\":8,\"name\":\"UndoActions\",\"url\":\"enums/UndoActions.html\",\"classes\":\"\"},{\"kind\":16,\"name\":\"UNDO\",\"url\":\"enums/UndoActions.html#UNDO\",\"classes\":\"\",\"parent\":\"UndoActions\"},{\"kind\":16,\"name\":\"REDO\",\"url\":\"enums/UndoActions.html#REDO\",\"classes\":\"\",\"parent\":\"UndoActions\"},{\"kind\":16,\"name\":\"JUMP\",\"url\":\"enums/UndoActions.html#JUMP\",\"classes\":\"\",\"parent\":\"UndoActions\"},{\"kind\":16,\"name\":\"CLEAR_HISTORY\",\"url\":\"enums/UndoActions.html#CLEAR_HISTORY\",\"classes\":\"\",\"parent\":\"UndoActions\"},{\"kind\":256,\"name\":\"UndoState\",\"url\":\"interfaces/UndoState.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"past\",\"url\":\"interfaces/UndoState.html#past\",\"classes\":\"\",\"parent\":\"UndoState\"},{\"kind\":1024,\"name\":\"future\",\"url\":\"interfaces/UndoState.html#future\",\"classes\":\"\",\"parent\":\"UndoState\"},{\"kind\":256,\"name\":\"NgUndoState\",\"url\":\"interfaces/NgUndoState.html\",\"classes\":\"\"},{\"kind\":256,\"name\":\"NgUndoAction\",\"url\":\"interfaces/NgUndoAction.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"type\",\"url\":\"interfaces/NgUndoAction.html#type-1\",\"classes\":\"\",\"parent\":\"NgUndoAction\"},{\"kind\":1024,\"name\":\"payload\",\"url\":\"interfaces/NgUndoAction.html#payload\",\"classes\":\"\",\"parent\":\"NgUndoAction\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/NgUndoAction.html#payload.__type\",\"classes\":\"\",\"parent\":\"NgUndoAction.payload\"},{\"kind\":1024,\"name\":\"type\",\"url\":\"interfaces/NgUndoAction.html#payload.__type.type\",\"classes\":\"\",\"parent\":\"NgUndoAction.payload.__type\"},{\"kind\":1024,\"name\":\"propertyName\",\"url\":\"interfaces/NgUndoAction.html#payload.__type.propertyName\",\"classes\":\"\",\"parent\":\"NgUndoAction.payload.__type\"},{\"kind\":1024,\"name\":\"index\",\"url\":\"interfaces/NgUndoAction.html#payload.__type.index\",\"classes\":\"\",\"parent\":\"NgUndoAction.payload.__type\"},{\"kind\":256,\"name\":\"StateWatchMap\",\"url\":\"interfaces/StateWatchMap.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/StateWatchMap.html#__index.__type\",\"classes\":\"\",\"parent\":\"StateWatchMap.__index\"},{\"kind\":1024,\"name\":\"path\",\"url\":\"interfaces/StateWatchMap.html#__index.__type.path\",\"classes\":\"\",\"parent\":\"StateWatchMap.__index.__type\"},{\"kind\":1024,\"name\":\"filter\",\"url\":\"interfaces/StateWatchMap.html#__index.__type.filter\",\"classes\":\"\",\"parent\":\"StateWatchMap.__index.__type\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/StateWatchMap.html#__index.__type.filter.__type-1\",\"classes\":\"\",\"parent\":\"StateWatchMap.__index.__type.filter\"},{\"kind\":1024,\"name\":\"limit\",\"url\":\"interfaces/StateWatchMap.html#__index.__type.limit\",\"classes\":\"\",\"parent\":\"StateWatchMap.__index.__type\"},{\"kind\":256,\"name\":\"Settings\",\"url\":\"interfaces/Settings.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"path\",\"url\":\"interfaces/Settings.html#path\",\"classes\":\"\",\"parent\":\"Settings\"},{\"kind\":1024,\"name\":\"filter\",\"url\":\"interfaces/Settings.html#filter\",\"classes\":\"\",\"parent\":\"Settings\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/Settings.html#filter.__type\",\"classes\":\"\",\"parent\":\"Settings.filter\"},{\"kind\":1024,\"name\":\"limit\",\"url\":\"interfaces/Settings.html#limit\",\"classes\":\"\",\"parent\":\"Settings\"},{\"kind\":64,\"name\":\"undo\",\"url\":\"functions/undo.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"redo\",\"url\":\"functions/redo.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"clearHistory\",\"url\":\"functions/clearHistory.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"jump\",\"url\":\"functions/jump.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"ngUndoState\",\"url\":\"functions/ngUndoState-1.html\",\"classes\":\"\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,33.557]],[\"comment/0\",[]],[\"name/1\",[1,33.557]],[\"comment/1\",[]],[\"name/2\",[2,33.557]],[\"comment/2\",[]],[\"name/3\",[3,33.557]],[\"comment/3\",[]],[\"name/4\",[4,20.565]],[\"comment/4\",[]],[\"name/5\",[5,33.557]],[\"comment/5\",[]],[\"name/6\",[6,33.557]],[\"comment/6\",[]],[\"name/7\",[7,33.557]],[\"comment/7\",[]],[\"name/8\",[8,33.557]],[\"comment/8\",[]],[\"name/9\",[9,33.557]],[\"comment/9\",[]],[\"name/10\",[10,33.557]],[\"comment/10\",[]],[\"name/11\",[11,28.449]],[\"comment/11\",[]],[\"name/12\",[12,28.449]],[\"comment/12\",[]],[\"name/13\",[13,28.449]],[\"comment/13\",[]],[\"name/14\",[14,33.557]],[\"comment/14\",[]],[\"name/15\",[15,33.557]],[\"comment/15\",[]],[\"name/16\",[16,33.557]],[\"comment/16\",[]],[\"name/17\",[17,33.557]],[\"comment/17\",[]],[\"name/18\",[18,28.449]],[\"comment/18\",[]],[\"name/19\",[19,33.557]],[\"comment/19\",[]],[\"name/20\",[20,28.449]],[\"comment/20\",[]],[\"name/21\",[21,33.557]],[\"comment/21\",[]],[\"name/22\",[4,20.565]],[\"comment/22\",[]],[\"name/23\",[20,28.449]],[\"comment/23\",[]],[\"name/24\",[22,33.557]],[\"comment/24\",[]],[\"name/25\",[23,33.557]],[\"comment/25\",[]],[\"name/26\",[24,33.557]],[\"comment/26\",[]],[\"name/27\",[4,20.565]],[\"comment/27\",[]],[\"name/28\",[25,28.449]],[\"comment/28\",[]],[\"name/29\",[26,28.449]],[\"comment/29\",[]],[\"name/30\",[4,20.565]],[\"comment/30\",[]],[\"name/31\",[27,28.449]],[\"comment/31\",[]],[\"name/32\",[28,33.557]],[\"comment/32\",[]],[\"name/33\",[25,28.449]],[\"comment/33\",[]],[\"name/34\",[26,28.449]],[\"comment/34\",[]],[\"name/35\",[4,20.565]],[\"comment/35\",[]],[\"name/36\",[27,28.449]],[\"comment/36\",[]],[\"name/37\",[11,28.449]],[\"comment/37\",[]],[\"name/38\",[12,28.449]],[\"comment/38\",[]],[\"name/39\",[29,33.557]],[\"comment/39\",[]],[\"name/40\",[13,28.449]],[\"comment/40\",[]],[\"name/41\",[18,28.449]],[\"comment/41\",[]]],\"invertedIndex\":[[\"__type\",{\"_index\":4,\"name\":{\"4\":{},\"22\":{},\"27\":{},\"30\":{},\"35\":{}},\"comment\":{}}],[\"clear_history\",{\"_index\":14,\"name\":{\"14\":{}},\"comment\":{}}],[\"clearhistory\",{\"_index\":29,\"name\":{\"39\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"detectchange\",{\"_index\":7,\"name\":{\"7\":{}},\"comment\":{}}],[\"filter\",{\"_index\":26,\"name\":{\"29\":{},\"34\":{}},\"comment\":{}}],[\"future\",{\"_index\":17,\"name\":{\"17\":{}},\"comment\":{}}],[\"history_state_key\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"index\",{\"_index\":23,\"name\":{\"25\":{}},\"comment\":{}}],[\"jump\",{\"_index\":13,\"name\":{\"13\":{},\"40\":{}},\"comment\":{}}],[\"limit\",{\"_index\":27,\"name\":{\"31\":{},\"36\":{}},\"comment\":{}}],[\"ngundoaction\",{\"_index\":19,\"name\":{\"19\":{}},\"comment\":{}}],[\"ngundomiddleware\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"ngundostate\",{\"_index\":18,\"name\":{\"18\":{},\"41\":{}},\"comment\":{}}],[\"past\",{\"_index\":16,\"name\":{\"16\":{}},\"comment\":{}}],[\"path\",{\"_index\":25,\"name\":{\"28\":{},\"33\":{}},\"comment\":{}}],[\"payload\",{\"_index\":21,\"name\":{\"21\":{}},\"comment\":{}}],[\"propertyname\",{\"_index\":22,\"name\":{\"24\":{}},\"comment\":{}}],[\"redo\",{\"_index\":12,\"name\":{\"12\":{},\"38\":{}},\"comment\":{}}],[\"settings\",{\"_index\":28,\"name\":{\"32\":{}},\"comment\":{}}],[\"statewatchmap\",{\"_index\":24,\"name\":{\"26\":{}},\"comment\":{}}],[\"type\",{\"_index\":20,\"name\":{\"20\":{},\"23\":{}},\"comment\":{}}],[\"undo\",{\"_index\":11,\"name\":{\"11\":{},\"37\":{}},\"comment\":{}}],[\"undo_reducer_prefix\",{\"_index\":9,\"name\":{\"9\":{}},\"comment\":{}}],[\"undoactions\",{\"_index\":10,\"name\":{\"10\":{}},\"comment\":{}}],[\"undoservice\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"undostate\",{\"_index\":15,\"name\":{\"15\":{}},\"comment\":{}}],[\"watcheraction\",{\"_index\":6,\"name\":{\"6\":{}},\"comment\":{}}],[\"watcherstate\",{\"_index\":5,\"name\":{\"5\":{}},\"comment\":{}}],[\"watchstatemap\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file diff --git a/docs/classes/UndoService.html b/docs/classes/UndoService.html index 4bbdeea..59bbd30 100644 --- a/docs/classes/UndoService.html +++ b/docs/classes/UndoService.html @@ -20,7 +20,7 @@

Hierarchy

+
  • Defined in services/undo.service.ts:26
  • @@ -58,7 +58,7 @@
    stateWatchMap: Returns UndoService
    +
  • Defined in services/undo.service.ts:46
  • Properties

    @@ -72,13 +72,13 @@

    Type declaration

  • [key: string]: NgUndoStateActions
  • +
  • Defined in services/undo.service.ts:35
  • Methods

      - +
    • Protected

      Detects changes in the state and inserts snapshots into the undo history when necessary.

      @@ -86,6 +86,10 @@
      • +
        action: any
        +

        The dispatched action object.

        +
      • +
      • state: any

        The current state object.

      • @@ -98,7 +102,7 @@

        Returns any

    +
  • Defined in services/undo.service.ts:117
  • +
  • Defined in services/undo.service.ts:81
  • +
  • Defined in services/undo.service.ts:64
  • +
  • Defined in interfaces/undo.interface.ts:35
  • @@ -42,22 +42,22 @@

    Enumeration Members

    CLEAR_HISTORY: "clean_history"
    +
  • Defined in interfaces/undo.interface.ts:39
  • JUMP: "jump"
    +
  • Defined in interfaces/undo.interface.ts:38
  • REDO: "redo"
    +
  • Defined in interfaces/undo.interface.ts:37
  • UNDO: "undo"
    +
  • Defined in interfaces/undo.interface.ts:36
  • +
  • Defined in interfaces/undo.interface.ts:5