- client: Submit setFiltersConfig action on if the values are changed: Merge pull request #637 in DNS/adguard-home from fix/1749 to master
Close #1749 Squashed commit of the following: commit aaf4ba86429670ea8b0001325562c4a173be5b4a Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri May 29 13:29:44 2020 +0300 - client: Submit setFiltersConfig action on if the values are changed
This commit is contained in:
@@ -482,6 +482,19 @@ export const getCurrentFilter = (url, filters) => {
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {object} initialValues
|
||||
* @param {object} values
|
||||
* @returns {object} Returns different values of objects
|
||||
*/
|
||||
export const getObjDiff = (initialValues, values) => Object.entries(values)
|
||||
.reduce((acc, [key, value]) => {
|
||||
if (value !== initialValues[key]) {
|
||||
acc[key] = value;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
/**
|
||||
* @param number Number to format
|
||||
* @returns string Returns a string with a language-sensitive representation of this number
|
||||
|
||||
Reference in New Issue
Block a user