react-memory-optimization 0.0.112 → 0.0.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +1 -1
- package/dist/lib/store/new-flow/store/UI/Categories/index.d.ts +19 -0
- package/dist/lib/store/new-flow/store/UI/Categories/service/index.d.ts +7 -0
- package/dist/lib/store/new-flow/store/UI/Categories/types.d.ts +30 -0
- package/dist/lib/store/new-flow/store/UI/Categories/types.js +2 -0
- package/dist/lib/store/new-flow/store/UI/index.d.ts +4 -0
- package/dist/lib/store/new-flow/transport/api-transport.js +6 -7
- package/dist/lib/store/new-flow/transport/types.d.ts +2 -1
- package/dist/lib/store/new-flow/transport/types.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ObservableEntity } from 'service/observableEntity';
|
|
2
|
+
import { UIService } from '../service';
|
|
3
|
+
import { BaseObservableSubscriber, UpdateData } from 'service/observable/type';
|
|
4
|
+
import { CasinoCategory } from './types';
|
|
5
|
+
import { CategoriesService } from './service';
|
|
6
|
+
export declare class Categories extends ObservableEntity<undefined> {
|
|
7
|
+
uiService: UIService;
|
|
8
|
+
_categories: CasinoCategory[] | null;
|
|
9
|
+
categoriesService: CategoriesService;
|
|
10
|
+
_status: 'idle' | 'loading' | 'success' | 'error';
|
|
11
|
+
constructor(uiService: UIService);
|
|
12
|
+
set categories(categories: CasinoCategory[]);
|
|
13
|
+
get categories(): CasinoCategory[] | null;
|
|
14
|
+
set status(status: 'idle' | 'loading' | 'success' | 'error');
|
|
15
|
+
get status(): 'idle' | 'loading' | 'success' | 'error';
|
|
16
|
+
sendUpdateEntity(d: BaseObservableSubscriber & {
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}): UpdateData | null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type ResponseCasinoCategory = {
|
|
2
|
+
id: string;
|
|
3
|
+
position: number;
|
|
4
|
+
subCategories: ResponseCasinoSubCategory[];
|
|
5
|
+
translates: CasinoCategoryTranslate[];
|
|
6
|
+
};
|
|
7
|
+
export type ResponseCasinoSubCategory = {
|
|
8
|
+
id: string;
|
|
9
|
+
translates: CasinoSubCategoryTranslate[];
|
|
10
|
+
};
|
|
11
|
+
export type CasinoCategoryTranslate = {
|
|
12
|
+
code: string;
|
|
13
|
+
categoryName: string;
|
|
14
|
+
categoryDescription: string;
|
|
15
|
+
};
|
|
16
|
+
export type CasinoSubCategoryTranslate = {
|
|
17
|
+
code: string;
|
|
18
|
+
subCategoryName: string;
|
|
19
|
+
subCategoryDescription: string;
|
|
20
|
+
};
|
|
21
|
+
export type CasinoCategory = {
|
|
22
|
+
id: string;
|
|
23
|
+
position: number;
|
|
24
|
+
subCategories: CasinoSubCategory[];
|
|
25
|
+
translate: CasinoCategoryTranslate;
|
|
26
|
+
};
|
|
27
|
+
export type CasinoSubCategory = {
|
|
28
|
+
id: string;
|
|
29
|
+
translate: CasinoSubCategoryTranslate;
|
|
30
|
+
};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { NewFlowEntity } from 'store/new-flow';
|
|
2
2
|
import { HomePage } from './Home';
|
|
3
3
|
import { UIService } from './service';
|
|
4
|
+
import { Categories } from './Categories';
|
|
4
5
|
export declare class UIEntities {
|
|
5
6
|
root: NewFlowEntity;
|
|
6
7
|
_homePage: HomePage | null;
|
|
7
8
|
uiService: UIService;
|
|
9
|
+
_categories: Categories | null;
|
|
8
10
|
constructor(root: NewFlowEntity);
|
|
9
11
|
set homePage(homePage: HomePage);
|
|
10
12
|
get homePage(): HomePage | null;
|
|
13
|
+
set categories(categories: Categories);
|
|
14
|
+
get categories(): Categories | null;
|
|
11
15
|
init(): void;
|
|
12
16
|
}
|
|
@@ -7,7 +7,7 @@ class ApiTransport {
|
|
|
7
7
|
this.baseHeaders = {
|
|
8
8
|
'Content-Type': 'application/json',
|
|
9
9
|
// Notice: move to settings
|
|
10
|
-
'x-brand-prefix': 'gobo-
|
|
10
|
+
'x-brand-prefix': 'gobo-e5ec954d',
|
|
11
11
|
};
|
|
12
12
|
this._isConfigured = false;
|
|
13
13
|
this._requestQueue = [];
|
|
@@ -36,10 +36,11 @@ class ApiTransport {
|
|
|
36
36
|
try {
|
|
37
37
|
const response = await fetch(`${this._baseUrl}${path}`, {
|
|
38
38
|
method: 'GET',
|
|
39
|
-
headers: {
|
|
40
|
-
'Content-Type': 'application/json',
|
|
41
|
-
},
|
|
39
|
+
headers: Object.assign(Object.assign({}, this.baseHeaders), { 'Content-Type': 'application/json' }),
|
|
42
40
|
});
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
43
44
|
return response.json();
|
|
44
45
|
}
|
|
45
46
|
catch (error) {
|
|
@@ -52,9 +53,7 @@ class ApiTransport {
|
|
|
52
53
|
const response = await fetch(`${this._baseUrl}${path}`, {
|
|
53
54
|
method: 'POST',
|
|
54
55
|
body: JSON.stringify(data),
|
|
55
|
-
headers: {
|
|
56
|
-
'Content-Type': 'application/json',
|
|
57
|
-
},
|
|
56
|
+
headers: Object.assign(Object.assign({}, this.baseHeaders), { 'Content-Type': 'application/json' }),
|
|
58
57
|
});
|
|
59
58
|
return response.json();
|
|
60
59
|
}
|
|
@@ -3,5 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ETransportPath = void 0;
|
|
4
4
|
var ETransportPath;
|
|
5
5
|
(function (ETransportPath) {
|
|
6
|
-
ETransportPath["HomeBanners"] = "/banners";
|
|
6
|
+
ETransportPath["HomeBanners"] = "/casino/banners";
|
|
7
|
+
ETransportPath["Categories"] = "/casino/categories";
|
|
7
8
|
})(ETransportPath || (exports.ETransportPath = ETransportPath = {}));
|