final-form-persist
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -8,7 +8,7 @@ import { Decorator } from "final-form"; | ||
} | ||
export interface FinalFormPersistDecorator { | ||
persistDecorator: Decorator; | ||
export interface FinalFormPersistDecorator<FormValues = object> { | ||
persistDecorator: Decorator<FormValues>; | ||
clear: () => void; | ||
isPersisted: () => boolean; | ||
} | ||
export declare const createPersistDecorator: (options: FinalFormPersistOptions) => FinalFormPersistDecorator; | ||
export declare const createPersistDecorator: <FormValues = object>(options: FinalFormPersistOptions) => FinalFormPersistDecorator<FormValues>; |
@@ -411,3 +411,3 @@ /*! ***************************************************************************** | ||
var initialValues = form.getState().initialValues; | ||
form.initialize(__assign({}, initialValues, JSON.parse(persistedValues))); | ||
form.initialize(__assign(__assign({}, initialValues), JSON.parse(persistedValues))); | ||
var unsubscribe = form.subscribe(lodash_debounce(function (_a) { | ||
@@ -417,7 +417,9 @@ var values = _a.values, pristine = _a.pristine; | ||
if (whitelist.length > 0) { | ||
valuesKeys = Object.keys(values).filter(function (value) { return whitelist.includes(value); }); | ||
valuesKeys = Object.keys(values).filter(function (value) { | ||
return whitelist.includes(value); | ||
}); | ||
} | ||
var valuesObject = valuesKeys.reduce(function (acc, key) { | ||
var _a; | ||
return __assign({}, acc, (_a = {}, _a[key] = values[key], _a)); | ||
return __assign(__assign({}, acc), (_a = {}, _a[key] = values[key], _a)); | ||
}, {}); | ||
@@ -442,3 +444,3 @@ if (!pristine) { | ||
clear: clear, | ||
isPersisted: isPersisted | ||
isPersisted: isPersisted, | ||
}; | ||
@@ -445,0 +447,0 @@ }; |
@@ -415,3 +415,3 @@ 'use strict'; | ||
var initialValues = form.getState().initialValues; | ||
form.initialize(__assign({}, initialValues, JSON.parse(persistedValues))); | ||
form.initialize(__assign(__assign({}, initialValues), JSON.parse(persistedValues))); | ||
var unsubscribe = form.subscribe(lodash_debounce(function (_a) { | ||
@@ -421,7 +421,9 @@ var values = _a.values, pristine = _a.pristine; | ||
if (whitelist.length > 0) { | ||
valuesKeys = Object.keys(values).filter(function (value) { return whitelist.includes(value); }); | ||
valuesKeys = Object.keys(values).filter(function (value) { | ||
return whitelist.includes(value); | ||
}); | ||
} | ||
var valuesObject = valuesKeys.reduce(function (acc, key) { | ||
var _a; | ||
return __assign({}, acc, (_a = {}, _a[key] = values[key], _a)); | ||
return __assign(__assign({}, acc), (_a = {}, _a[key] = values[key], _a)); | ||
}, {}); | ||
@@ -446,3 +448,3 @@ if (!pristine) { | ||
clear: clear, | ||
isPersisted: isPersisted | ||
isPersisted: isPersisted, | ||
}; | ||
@@ -449,0 +451,0 @@ }; |
{ | ||
"name": "final-form-persist", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Persist your form values into a storage", | ||
@@ -32,3 +32,3 @@ "author": "premieroctet", | ||
"rollup-plugin-typescript2": "^0.17.0", | ||
"typescript": "^2.8.3" | ||
"typescript": "^3.8.3" | ||
}, | ||
@@ -35,0 +35,0 @@ "files": [ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
90895
821
0