@evlop/commons 1.0.171 → 1.0.173
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
|
|
1
1
|
export declare const REGISTER_ICON = "REGISTER_ICON";
|
2
|
-
export declare const REGISTER_ICONS = "
|
2
|
+
export declare const REGISTER_ICONS = "REGISTER_ICONS";
|
3
3
|
export declare function registerIcon(icon: any): {
|
4
4
|
type: string;
|
5
5
|
icon: any;
|
@@ -9,7 +9,7 @@ export declare function registerIcons(icons: any[]): {
|
|
9
9
|
icons: any[];
|
10
10
|
};
|
11
11
|
export declare const getIcons: (() => Promise<any>) & import("lodash").MemoizedFunction;
|
12
|
-
export declare function fetchIcons(): (dispatch: Function) => void
|
12
|
+
export declare function fetchIcons(): (dispatch: Function) => Promise<void>;
|
13
13
|
declare const _default: (state: any, action: any) => any;
|
14
14
|
export default _default;
|
15
15
|
//# sourceMappingURL=icons.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/reducers/icons.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,cAAc,
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/reducers/icons.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG;;;EAKrC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE;;;EAKzC;AAED,eAAO,MAAM,QAAQ,0DAA6F,CAAA;AAClH,wBAAgB,UAAU,eACE,QAAQ,mBAInC;;AAKD,wBAeC"}
|
@@ -1,4 +1,13 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
13
|
};
|
@@ -7,7 +16,7 @@ exports.fetchIcons = exports.getIcons = exports.registerIcons = exports.register
|
|
7
16
|
const lodash_1 = require("lodash");
|
8
17
|
const axios_1 = __importDefault(require("../helpers/axios"));
|
9
18
|
exports.REGISTER_ICON = 'REGISTER_ICON';
|
10
|
-
exports.REGISTER_ICONS = '
|
19
|
+
exports.REGISTER_ICONS = 'REGISTER_ICONS';
|
11
20
|
function registerIcon(icon) {
|
12
21
|
return {
|
13
22
|
type: exports.REGISTER_ICON,
|
@@ -17,18 +26,17 @@ function registerIcon(icon) {
|
|
17
26
|
exports.registerIcon = registerIcon;
|
18
27
|
function registerIcons(icons) {
|
19
28
|
return {
|
20
|
-
type: exports.
|
29
|
+
type: exports.REGISTER_ICONS,
|
21
30
|
icons
|
22
31
|
};
|
23
32
|
}
|
24
33
|
exports.registerIcons = registerIcons;
|
25
34
|
exports.getIcons = lodash_1.memoize(() => axios_1.default.get('https://cdn.evlop.com/assets-info/icons.json?v=9').then(r => r.data));
|
26
35
|
function fetchIcons() {
|
27
|
-
return (dispatch) => {
|
28
|
-
exports.getIcons()
|
29
|
-
|
30
|
-
|
31
|
-
};
|
36
|
+
return (dispatch) => __awaiter(this, void 0, void 0, function* () {
|
37
|
+
const icons = yield exports.getIcons();
|
38
|
+
dispatch(registerIcons(icons));
|
39
|
+
});
|
32
40
|
}
|
33
41
|
exports.fetchIcons = fetchIcons;
|
34
42
|
let initialState = [];
|
@@ -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,mCAAwD;AACxD,6DAAqC;AAExB,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAE/C,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,sBAAc;QACpB,KAAK;KACR,CAAC;AACN,CAAC;AALD,sCAKC;AAEY,QAAA,QAAQ,GAAG,gBAAO,CAAC,GAAE,EAAE,CAAA,eAAK,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;AAClH,SAAgB,UAAU;IACtB,OAAO,CAAO,QAAkB,EAAC,EAAE;QAC/B,MAAM,KAAK,GAAG,MAAM,gBAAQ,EAAE,CAAC;QAC/B,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IACnC,CAAC,CAAA,CAAA;AACL,CAAC;AALD,gCAKC;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,MAAM,QAAQ,GAAG,eAAM,CAAC,CAAC,GAAG,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;YACtD,eAAM,CAAC,QAAQ,EAAE,cAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;YACxC,OAAO,QAAQ,CAAC;SACnB;QACD,KAAK,sBAAc,CAAC,CAAA;YAChB,MAAM,QAAQ,GAAG,eAAM,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAA;YAC1D,eAAM,CAAC,QAAQ,EAAE,cAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;YACxC,OAAO,QAAQ,CAAC;SACnB;QACD;YACI,OAAO,KAAK,CAAC;KACpB;AACL,CAAC,CAAA"}
|