Comparing version 2.0.0 to 2.0.1
@@ -1,1 +0,1 @@ | ||
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@ngrx/store"),require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@ngrx/store","@angular/core"],factory):factory(global.ngrxUndo=global.ngrxUndo||{},global.ngrx.store,global.ng.core)}(this,function(exports,_ngrx_store,_angular_core){"use strict";function handleUndo(rootReducer,bufferSize){var executedActions=[],initialState=void 0;return function(state,action){if(action.type===UNDO_ACTION){var newState_1=initialState;return executedActions=executedActions.filter(function(eAct){return eAct!==action.payload}),executedActions.forEach(function(executedAction){return newState_1=rootReducer(newState_1,executedAction)}),newState_1}executedActions.push(action);var updatedState=rootReducer(state,action);if(executedActions.length===bufferSize+1){var firstAction=executedActions[0];initialState=rootReducer(initialState,firstAction),executedActions=executedActions.slice(1,bufferSize+1)}return updatedState}}function createReducer(dispatcher,reducer,options){return new _ngrx_store.Reducer(dispatcher,handleUndo(reducer,options.bufferSize))}function undo(action){return{type:UNDO_ACTION,payload:action}}var UNDO_ACTION="ngrx-undo/UNDO_ACTION",UNDO_DEVTOOLS_CONFIG=new _angular_core.OpaqueToken("@ngrx/undodevtools Options"),StoreUndoModule=function(){function StoreUndoModule(){}return StoreUndoModule.interceptStore=function(options){return void 0===options&&(options={bufferSize:100}),{ngModule:StoreUndoModule,providers:[{provide:UNDO_DEVTOOLS_CONFIG,useValue:options},{provide:_ngrx_store.Reducer,deps:[_ngrx_store.Dispatcher,_ngrx_store.INITIAL_REDUCER,UNDO_DEVTOOLS_CONFIG],useFactory:createReducer}]}},StoreUndoModule}();StoreUndoModule.decorators=[{type:_angular_core.NgModule,args:[{imports:[_ngrx_store.StoreModule]}]}],StoreUndoModule.ctorParameters=function(){return[]},exports.UNDO_DEVTOOLS_CONFIG=UNDO_DEVTOOLS_CONFIG,exports.StoreUndoModule=StoreUndoModule,exports.UNDO_ACTION=UNDO_ACTION,exports.undo=undo,Object.defineProperty(exports,"__esModule",{value:!0})}); | ||
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@ngrx/store"),require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@ngrx/store","@angular/core"],factory):factory(global.ngrxUndo=global.ngrxUndo||{},global.ngrx.store,global.ng.core)}(this,function(exports,_ngrx_store,_angular_core){"use strict";function handleUndo(rootReducer,bufferSize){var executedActions=[],initialState=void 0;return function(state,action){if(action.type===UNDO_ACTION){var newState_1=initialState;return executedActions=executedActions.filter(function(eAct){return eAct!==action.payload}),executedActions.forEach(function(executedAction){return newState_1=rootReducer(newState_1,executedAction)}),newState_1}executedActions.push(action);var updatedState=rootReducer(state,action);if(executedActions.length===bufferSize+1){var firstAction=executedActions[0];initialState=rootReducer(initialState,firstAction),executedActions=executedActions.slice(1,bufferSize+1)}return updatedState}}function createReducer(dispatcher,reducer,options){return new _ngrx_store.Reducer(dispatcher,handleUndo(reducer,options.bufferSize))}function undo(action){return{type:UNDO_ACTION,payload:action}}var UNDO_ACTION="ngrx-undo/UNDO_ACTION",UNDO_DEVTOOLS_CONFIG=new _angular_core.OpaqueToken("@ngrx/undodevtools Options"),StoreUndoModule=function(){function StoreUndoModule(){}return StoreUndoModule.interceptStore=function(options){return void 0===options&&(options={bufferSize:100}),{ngModule:StoreUndoModule,providers:[{provide:UNDO_DEVTOOLS_CONFIG,useValue:options},{provide:_ngrx_store.Reducer,deps:[_ngrx_store.Dispatcher,_ngrx_store.INITIAL_REDUCER,UNDO_DEVTOOLS_CONFIG],useFactory:createReducer}]}},StoreUndoModule.decorators=[{type:_angular_core.NgModule,args:[{imports:[_ngrx_store.StoreModule]}]}],StoreUndoModule.ctorParameters=function(){return[]},StoreUndoModule}();exports.UNDO_DEVTOOLS_CONFIG=UNDO_DEVTOOLS_CONFIG,exports.StoreUndoModule=StoreUndoModule,exports.UNDO_ACTION=UNDO_ACTION,exports.undo=undo,Object.defineProperty(exports,"__esModule",{value:!0})}); |
@@ -42,3 +42,3 @@ (function (global, factory) { | ||
var UNDO_ACTION = "ngrx-undo/UNDO_ACTION"; | ||
var UNDO_ACTION = 'ngrx-undo/UNDO_ACTION'; | ||
function undo(action) { | ||
@@ -52,3 +52,3 @@ return { | ||
var UNDO_DEVTOOLS_CONFIG = new _angular_core.OpaqueToken('@ngrx/undodevtools Options'); | ||
var StoreUndoModule = (function () { | ||
var StoreUndoModule = /** @class */ (function () { | ||
function StoreUndoModule() { | ||
@@ -70,13 +70,13 @@ } | ||
}; | ||
StoreUndoModule.decorators = [ | ||
{ type: _angular_core.NgModule, args: [{ | ||
imports: [ | ||
_ngrx_store.StoreModule | ||
] | ||
},] }, | ||
]; | ||
/** @nocollapse */ | ||
StoreUndoModule.ctorParameters = function () { return []; }; | ||
return StoreUndoModule; | ||
}()); | ||
StoreUndoModule.decorators = [ | ||
{ type: _angular_core.NgModule, args: [{ | ||
imports: [ | ||
_ngrx_store.StoreModule | ||
] | ||
},] }, | ||
]; | ||
/** @nocollapse */ | ||
StoreUndoModule.ctorParameters = function () { return []; }; | ||
@@ -83,0 +83,0 @@ exports.UNDO_DEVTOOLS_CONFIG = UNDO_DEVTOOLS_CONFIG; |
{ | ||
"name": "ngrx-undo", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Undo support for @ngrx/store", | ||
@@ -64,4 +64,4 @@ "license": "MIT", | ||
"rxjs": "^5.1.0", | ||
"@ngrx/store": "^2.2.1" | ||
"@ngrx/store": "^4.0.0" | ||
} | ||
} |
@@ -1,4 +0,4 @@ | ||
import { Reducer, Dispatcher } from "@ngrx/store"; | ||
import { Dispatcher, Reducer } from '@ngrx/store'; | ||
export declare function createReducer(dispatcher: Dispatcher, reducer: any, options: { | ||
bufferSize: 100; | ||
}): Reducer; |
@@ -1,3 +0,3 @@ | ||
import { Reducer } from "@ngrx/store"; | ||
import { handleUndo } from "./handleUndo"; | ||
import { Reducer } from '@ngrx/store'; | ||
import { handleUndo } from './handleUndo'; | ||
export function createReducer(dispatcher, reducer, options) { | ||
@@ -4,0 +4,0 @@ return new Reducer(dispatcher, handleUndo(reducer, options.bufferSize)); |
@@ -1,2 +0,2 @@ | ||
import { ActionReducer } from "@ngrx/store"; | ||
import { ActionReducer } from '@ngrx/store'; | ||
export declare function handleUndo(rootReducer: ActionReducer<any>, bufferSize: any): ActionReducer<any>; |
@@ -1,2 +0,2 @@ | ||
import { UNDO_ACTION } from "./storeUndo"; | ||
import { UNDO_ACTION } from './storeUndo'; | ||
export function handleUndo(rootReducer, bufferSize) { | ||
@@ -3,0 +3,0 @@ var executedActions = []; |
@@ -1,4 +0,4 @@ | ||
import { Reducer, Dispatcher } from '@ngrx/store'; | ||
import { Dispatcher, Reducer } from '@ngrx/store'; | ||
import { OpaqueToken } from '@angular/core'; | ||
export { UNDO_ACTION, undo } from "./undoAction"; | ||
export { UNDO_ACTION, undo } from './undoAction'; | ||
export declare const UNDO_DEVTOOLS_CONFIG: OpaqueToken; | ||
@@ -5,0 +5,0 @@ export declare class StoreUndoModule { |
@@ -1,7 +0,7 @@ | ||
import { Reducer, Dispatcher, INITIAL_REDUCER, StoreModule } from '@ngrx/store'; | ||
import { OpaqueToken, NgModule } from '@angular/core'; | ||
import { Dispatcher, INITIAL_REDUCER, Reducer, StoreModule } from '@ngrx/store'; | ||
import { NgModule, OpaqueToken } from '@angular/core'; | ||
import { createReducer } from './createReducer'; | ||
export { UNDO_ACTION, undo } from "./undoAction"; | ||
export { UNDO_ACTION, undo } from './undoAction'; | ||
export var UNDO_DEVTOOLS_CONFIG = new OpaqueToken('@ngrx/undodevtools Options'); | ||
var StoreUndoModule = (function () { | ||
var StoreUndoModule = /** @class */ (function () { | ||
function StoreUndoModule() { | ||
@@ -23,14 +23,14 @@ } | ||
}; | ||
StoreUndoModule.decorators = [ | ||
{ type: NgModule, args: [{ | ||
imports: [ | ||
StoreModule | ||
] | ||
},] }, | ||
]; | ||
/** @nocollapse */ | ||
StoreUndoModule.ctorParameters = function () { return []; }; | ||
return StoreUndoModule; | ||
}()); | ||
export { StoreUndoModule }; | ||
StoreUndoModule.decorators = [ | ||
{ type: NgModule, args: [{ | ||
imports: [ | ||
StoreModule | ||
] | ||
},] }, | ||
]; | ||
/** @nocollapse */ | ||
StoreUndoModule.ctorParameters = function () { return []; }; | ||
//# sourceMappingURL=storeUndo.js.map |
@@ -1,2 +0,2 @@ | ||
import { Action } from "@ngrx/store"; | ||
import { Action } from '@ngrx/store'; | ||
export declare const UNDO_ACTION = "ngrx-undo/UNDO_ACTION"; | ||
@@ -3,0 +3,0 @@ export declare function undo(action: Action): { |
@@ -1,2 +0,2 @@ | ||
export var UNDO_ACTION = "ngrx-undo/UNDO_ACTION"; | ||
export var UNDO_ACTION = 'ngrx-undo/UNDO_ACTION'; | ||
export function undo(action) { | ||
@@ -3,0 +3,0 @@ return { |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"UNDO_ACTION":"ngrx-undo/UNDO_ACTION","undo":{"__symbolic":"function","parameters":["action"],"value":{"type":"ngrx-undo/UNDO_ACTION","payload":{"__symbolic":"reference","name":"action"}}}}},{"__symbolic":"module","version":1,"metadata":{"UNDO_ACTION":"ngrx-undo/UNDO_ACTION","undo":{"__symbolic":"function","parameters":["action"],"value":{"type":"ngrx-undo/UNDO_ACTION","payload":{"__symbolic":"reference","name":"action"}}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"UNDO_ACTION":"ngrx-undo/UNDO_ACTION","undo":{"__symbolic":"function","parameters":["action"],"value":{"type":{"__symbolic":"reference","name":"UNDO_ACTION"},"payload":{"__symbolic":"reference","name":"action"}}}}},{"__symbolic":"module","version":1,"metadata":{"UNDO_ACTION":"ngrx-undo/UNDO_ACTION","undo":{"__symbolic":"function","parameters":["action"],"value":{"type":{"__symbolic":"reference","name":"UNDO_ACTION"},"payload":{"__symbolic":"reference","name":"action"}}}}}] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26391