react-memory-optimization 0.0.111 → 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/socket/index.d.ts +1 -1
- package/dist/lib/socket/types/socket.d.ts +1 -1
- package/dist/lib/{service → store}/new-flow/index.d.ts +7 -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/{service → store}/new-flow/store/UI/Home/Banners/index.d.ts +3 -0
- package/dist/lib/{service → store}/new-flow/store/UI/Home/service/index.d.ts +1 -1
- package/dist/lib/{service → store}/new-flow/store/UI/index.d.ts +5 -1
- package/dist/lib/store/new-flow/transport/api-transport.d.ts +21 -0
- package/dist/lib/store/new-flow/transport/api-transport.js +83 -0
- package/dist/lib/store/new-flow/transport/types.d.ts +9 -0
- package/dist/lib/store/new-flow/transport/types.js +8 -0
- package/dist/lib/store/new-flow/types.js +2 -0
- package/package.json +1 -1
- /package/dist/lib/{service/new-flow/store/UI/Home/Banners → store/new-flow/store/UI/Categories}/types.js +0 -0
- /package/dist/lib/{service → store}/new-flow/store/UI/Home/Banners/types.d.ts +0 -0
- /package/dist/lib/{service/new-flow → store/new-flow/store/UI/Home/Banners}/types.js +0 -0
- /package/dist/lib/{service → store}/new-flow/store/UI/Home/index.d.ts +0 -0
- /package/dist/lib/{service → store}/new-flow/store/UI/service/index.d.ts +0 -0
- /package/dist/lib/{service → store}/new-flow/types.d.ts +0 -0
|
@@ -30,7 +30,7 @@ import { SubscribeUserKeys } from 'store/user/types';
|
|
|
30
30
|
import { PromotionSubscribeProps } from 'store/casino/entities/promotions/types';
|
|
31
31
|
import { UIEntitiesSettings } from 'store/ui/types';
|
|
32
32
|
import { TournamentSubscribeProps } from 'store/casino/entities/casinoTournaments/types';
|
|
33
|
-
import { NewFlowEntity } from '
|
|
33
|
+
import { NewFlowEntity } from 'store/new-flow';
|
|
34
34
|
export declare class Socket implements SocketInterface {
|
|
35
35
|
socketServices: SocketServices;
|
|
36
36
|
initialSettings: ISocketSettings;
|
|
@@ -28,7 +28,7 @@ import { SubscribeUserKeys, UserInfoSettings } from 'store/user/types';
|
|
|
28
28
|
import { ResponseAdapter } from 'service/responseAdapter';
|
|
29
29
|
import { CasinoPromotionSettings, PromotionSubscribeProps } from 'store/casino/entities/promotions/types';
|
|
30
30
|
import { UIEntitiesSettings } from 'store/ui/types';
|
|
31
|
-
import { ShadowIntegrationSettings } from '
|
|
31
|
+
import { ShadowIntegrationSettings } from 'store/new-flow/types';
|
|
32
32
|
export declare enum ESocketCallbackStep {
|
|
33
33
|
Unknown = 0,
|
|
34
34
|
Init = 1,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { Socket } from 'index';
|
|
1
2
|
import { UIEntities } from './store/UI';
|
|
3
|
+
import { ApiTransport } from './transport/api-transport';
|
|
2
4
|
import { ShadowIntegrationSettings } from './types';
|
|
3
5
|
export declare class NewFlowEntity {
|
|
4
6
|
_settings: ShadowIntegrationSettings;
|
|
5
7
|
_uiEntities: UIEntities | null;
|
|
6
|
-
|
|
8
|
+
_apiTransport: ApiTransport;
|
|
9
|
+
_socketInstance: Socket;
|
|
10
|
+
constructor(socketInstance: Socket, settings?: ShadowIntegrationSettings);
|
|
11
|
+
set apiTransport(apiTransport: ApiTransport);
|
|
12
|
+
get apiTransport(): ApiTransport;
|
|
7
13
|
set settings(settings: ShadowIntegrationSettings);
|
|
8
14
|
get settings(): ShadowIntegrationSettings;
|
|
9
15
|
set uiEntities(uiEntities: UIEntities);
|
|
@@ -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
|
+
};
|
|
@@ -6,9 +6,12 @@ export declare class HomeBanners extends ObservableEntity<unknown> {
|
|
|
6
6
|
homeService?: null;
|
|
7
7
|
homePageService: HomePageService;
|
|
8
8
|
_banners: Banner[] | null;
|
|
9
|
+
_viewType: 'desktop' | 'mobile';
|
|
9
10
|
_sliderSettings: SliderSettings | null;
|
|
10
11
|
_status: 'idle' | 'loading' | 'error' | 'success';
|
|
11
12
|
constructor(service: HomePageService);
|
|
13
|
+
set viewType(viewType: 'desktop' | 'mobile');
|
|
14
|
+
get viewType(): 'desktop' | 'mobile';
|
|
12
15
|
set status(status: 'idle' | 'loading' | 'error' | 'success');
|
|
13
16
|
get status(): 'idle' | 'loading' | 'error' | 'success';
|
|
14
17
|
set banners(banners: Banner[]);
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { NewFlowEntity } from '
|
|
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
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ShadowIntegrationSettings } from '../types';
|
|
2
|
+
import { RequestQueue } from './types';
|
|
3
|
+
export declare class ApiTransport {
|
|
4
|
+
_baseUrl: string;
|
|
5
|
+
_isConfigured: boolean;
|
|
6
|
+
baseHeaders: Record<string, string>;
|
|
7
|
+
_requestQueue: RequestQueue[];
|
|
8
|
+
constructor();
|
|
9
|
+
set requestQueue(requestQueue: RequestQueue[]);
|
|
10
|
+
get requestQueue(): RequestQueue[];
|
|
11
|
+
set isConfigured(isConfigured: boolean);
|
|
12
|
+
get isConfigured(): boolean;
|
|
13
|
+
set baseUrl(baseUrl: string);
|
|
14
|
+
get baseUrl(): string;
|
|
15
|
+
get<T>(path: string): Promise<T | null>;
|
|
16
|
+
post<T>(path: string, data: any): Promise<T | null>;
|
|
17
|
+
configure(settings: ShadowIntegrationSettings): void;
|
|
18
|
+
subscribe(props: RequestQueue): void;
|
|
19
|
+
processRequestQueue(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare const apiTransport: ApiTransport;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.apiTransport = exports.ApiTransport = void 0;
|
|
4
|
+
class ApiTransport {
|
|
5
|
+
constructor() {
|
|
6
|
+
this._baseUrl = '';
|
|
7
|
+
this.baseHeaders = {
|
|
8
|
+
'Content-Type': 'application/json',
|
|
9
|
+
// Notice: move to settings
|
|
10
|
+
'x-brand-prefix': 'gobo-e5ec954d',
|
|
11
|
+
};
|
|
12
|
+
this._isConfigured = false;
|
|
13
|
+
this._requestQueue = [];
|
|
14
|
+
}
|
|
15
|
+
set requestQueue(requestQueue) {
|
|
16
|
+
this._requestQueue = requestQueue;
|
|
17
|
+
}
|
|
18
|
+
get requestQueue() {
|
|
19
|
+
return this._requestQueue;
|
|
20
|
+
}
|
|
21
|
+
set isConfigured(isConfigured) {
|
|
22
|
+
this._isConfigured = isConfigured;
|
|
23
|
+
this.processRequestQueue();
|
|
24
|
+
}
|
|
25
|
+
get isConfigured() {
|
|
26
|
+
return this._isConfigured;
|
|
27
|
+
}
|
|
28
|
+
set baseUrl(baseUrl) {
|
|
29
|
+
this.isConfigured = true;
|
|
30
|
+
this._baseUrl = baseUrl;
|
|
31
|
+
}
|
|
32
|
+
get baseUrl() {
|
|
33
|
+
return this._baseUrl;
|
|
34
|
+
}
|
|
35
|
+
async get(path) {
|
|
36
|
+
try {
|
|
37
|
+
const response = await fetch(`${this._baseUrl}${path}`, {
|
|
38
|
+
method: 'GET',
|
|
39
|
+
headers: Object.assign(Object.assign({}, this.baseHeaders), { 'Content-Type': 'application/json' }),
|
|
40
|
+
});
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return response.json();
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.error(error);
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async post(path, data) {
|
|
52
|
+
try {
|
|
53
|
+
const response = await fetch(`${this._baseUrl}${path}`, {
|
|
54
|
+
method: 'POST',
|
|
55
|
+
body: JSON.stringify(data),
|
|
56
|
+
headers: Object.assign(Object.assign({}, this.baseHeaders), { 'Content-Type': 'application/json' }),
|
|
57
|
+
});
|
|
58
|
+
return response.json();
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
console.error(error);
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
configure(settings) {
|
|
66
|
+
this.baseUrl = settings.baseUrl;
|
|
67
|
+
}
|
|
68
|
+
subscribe(props) {
|
|
69
|
+
this.requestQueue.push(props);
|
|
70
|
+
this.processRequestQueue();
|
|
71
|
+
}
|
|
72
|
+
processRequestQueue() {
|
|
73
|
+
if (!this.isConfigured) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this.requestQueue.forEach((request) => {
|
|
77
|
+
request.fn(request.fnProps);
|
|
78
|
+
});
|
|
79
|
+
this.requestQueue = [];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.ApiTransport = ApiTransport;
|
|
83
|
+
exports.apiTransport = new ApiTransport();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ETransportPath = void 0;
|
|
4
|
+
var ETransportPath;
|
|
5
|
+
(function (ETransportPath) {
|
|
6
|
+
ETransportPath["HomeBanners"] = "/casino/banners";
|
|
7
|
+
ETransportPath["Categories"] = "/casino/categories";
|
|
8
|
+
})(ETransportPath || (exports.ETransportPath = ETransportPath = {}));
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|