@evlop/commons 1.0.168 → 1.0.169
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,13 @@
|
|
1
1
|
export declare const REGISTER_ICON = "REGISTER_ICON";
|
2
|
+
export declare const REGISTER_ICONS = "REGISTER_ICON";
|
2
3
|
export declare function registerIcon(icon: any): {
|
3
4
|
type: string;
|
4
5
|
icon: any;
|
5
6
|
};
|
7
|
+
export declare function registerIcons(icons: any[]): {
|
8
|
+
type: string;
|
9
|
+
icons: any[];
|
10
|
+
};
|
6
11
|
declare const _default: (state: any, action: any) => any;
|
7
12
|
export default _default;
|
8
13
|
//# sourceMappingURL=icons.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/reducers/icons.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/reducers/icons.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG;;;EAKrC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE;;;EAKzC;;AAKD,wBAWC"}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.registerIcon = exports.REGISTER_ICON = void 0;
|
3
|
+
exports.registerIcons = exports.registerIcon = exports.REGISTER_ICONS = exports.REGISTER_ICON = void 0;
|
4
|
+
const lodash_1 = require("lodash");
|
4
5
|
exports.REGISTER_ICON = 'REGISTER_ICON';
|
6
|
+
exports.REGISTER_ICONS = 'REGISTER_ICON';
|
5
7
|
function registerIcon(icon) {
|
6
8
|
return {
|
7
9
|
type: exports.REGISTER_ICON,
|
@@ -9,11 +11,21 @@ function registerIcon(icon) {
|
|
9
11
|
};
|
10
12
|
}
|
11
13
|
exports.registerIcon = registerIcon;
|
14
|
+
function registerIcons(icons) {
|
15
|
+
return {
|
16
|
+
type: exports.REGISTER_ICON,
|
17
|
+
icons
|
18
|
+
};
|
19
|
+
}
|
20
|
+
exports.registerIcons = registerIcons;
|
12
21
|
let initialState = [];
|
13
22
|
exports.default = (state = initialState, action) => {
|
14
23
|
switch (action.type) {
|
15
24
|
case exports.REGISTER_ICON: {
|
16
|
-
return [...state, action.icon];
|
25
|
+
return lodash_1.uniqBy([...state, action.icon], 'id');
|
26
|
+
}
|
27
|
+
case exports.REGISTER_ICONS: {
|
28
|
+
return lodash_1.uniqBy([...state, ...action.icons], 'id');
|
17
29
|
}
|
18
30
|
default:
|
19
31
|
return state;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../../src/reducers/icons.tsx"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../../src/reducers/icons.tsx"],"names":[],"mappings":";;;AAAA,mCAAgC;AAEnB,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,cAAc,GAAG,eAAe,CAAC;AAE9C,SAAgB,YAAY,CAAC,IAAS;IAClC,OAAO;QACH,IAAI,EAAE,qBAAa;QACnB,IAAI;KACP,CAAC;AACN,CAAC;AALD,oCAKC;AAED,SAAgB,aAAa,CAAC,KAAY;IACtC,OAAO;QACH,IAAI,EAAE,qBAAa;QACnB,KAAK;KACR,CAAC;AACN,CAAC;AALD,sCAKC;AAED,IAAI,YAAY,GAAO,EACtB,CAAC;AAEF,kBAAe,CAAC,KAAK,GAAG,YAAY,EAAE,MAAM,EAAC,EAAE;IAC3C,QAAQ,MAAM,CAAC,IAAI,EAAE;QACjB,KAAK,qBAAa,CAAC,CAAA;YACf,OAAO,eAAM,CAAC,CAAC,GAAG,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;SAC/C;QACD,KAAK,sBAAc,CAAC,CAAA;YAChB,OAAO,eAAM,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAA;SACnD;QACD;YACI,OAAO,KAAK,CAAC;KACpB;AACL,CAAC,CAAA"}
|