@jetthai/cuora 1.1.22 → 1.1.23

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/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.1.23](https://github.com/jetthai/cuora-module/compare/v1.1.22...v1.1.23) (2023-01-03)
6
+
5
7
  ### [1.1.22](https://github.com/jetthai/cuora-module/compare/v1.1.21...v1.1.22) (2023-01-03)
6
8
 
7
9
  ### [1.1.21](https://github.com/jetthai/cuora-module/compare/v1.1.20...v1.1.21) (2022-12-30)
package/dist/bundle.mjs CHANGED
@@ -11254,6 +11254,11 @@ function game_v2 (request) {
11254
11254
  parentCategoryId: null,
11255
11255
  totalPage: 1,
11256
11256
  },
11257
+ addition: {
11258
+ data: [],
11259
+ timestamp: null,
11260
+ totalPage: 1,
11261
+ },
11257
11262
  // play params
11258
11263
  game: {
11259
11264
  providerId: null,
@@ -11438,6 +11443,11 @@ function game_v2 (request) {
11438
11443
  parentCategoryId: null,
11439
11444
  totalPage: 1,
11440
11445
  },
11446
+ addition: {
11447
+ data: [],
11448
+ timestamp: null,
11449
+ totalPage: 1,
11450
+ },
11441
11451
  }
11442
11452
  }),
11443
11453
  appendContent: assign((context, event) => {
@@ -11445,23 +11455,31 @@ function game_v2 (request) {
11445
11455
  if (room.categoryId === GAME_SEARCH) {
11446
11456
  return
11447
11457
  } else {
11448
- const { data, ...rest } = event.data;
11458
+ const [content, addition] = event.data;
11449
11459
  return {
11450
11460
  content: {
11451
11461
  ...context.content,
11452
- ...rest,
11453
- data: context.content.data.concat(data),
11462
+ ...content,
11463
+ data: context.content.data.concat(content.data),
11464
+ },
11465
+ addition: {
11466
+ ...context.addition,
11467
+ ...addition,
11468
+ data: context.addition.data.concat(addition.data),
11454
11469
  },
11455
11470
  }
11456
11471
  }
11457
11472
  }),
11458
11473
  swapContent: assign((context, event) => {
11459
- const item = event.data;
11460
- if (item?.data?.length) {
11461
- return {
11462
- content: event.data,
11463
- }
11474
+ const [content, addition] = event.data;
11475
+ let result = {};
11476
+ if (content?.data?.length) {
11477
+ result.content = content;
11478
+ }
11479
+ if (addition?.data?.length) {
11480
+ result.addition = addition;
11464
11481
  }
11482
+ return result
11465
11483
  }),
11466
11484
  increaseIndex: assign((context, event) => {
11467
11485
  return {
@@ -11498,7 +11516,8 @@ function game_v2 (request) {
11498
11516
  if (room.categoryId === GAME_SEARCH) {
11499
11517
  return
11500
11518
  } else {
11501
- return await request.send(game$1.getListCategory({ categoryId: room.categoryId, index }))
11519
+ const param = { categoryId: room.categoryId, index };
11520
+ return await Promise.all([request.send(game$1.getListCategory(param)), request.send(game$1.getListAddition(param))])
11502
11521
  }
11503
11522
  },
11504
11523
  updatePageContent: async (context, event) => {
@@ -11506,13 +11525,22 @@ function game_v2 (request) {
11506
11525
  if (room.categoryId === GAME_SEARCH) {
11507
11526
  return
11508
11527
  } else {
11509
- return await request.send(
11510
- game$1.getListCategoryByRange({
11511
- categoryId: room.categoryId,
11512
- end: index,
11513
- timestamp: content.timestamp,
11514
- })
11515
- )
11528
+ return await Promise.all([
11529
+ request.send(
11530
+ game$1.getListCategoryByRange({
11531
+ categoryId: room.categoryId,
11532
+ end: index,
11533
+ timestamp: content.timestamp,
11534
+ })
11535
+ ),
11536
+ request.send(
11537
+ game$1.getListAdditionByRange({
11538
+ categoryId: room.categoryId,
11539
+ end: index,
11540
+ timestamp: content.timestamp,
11541
+ })
11542
+ ),
11543
+ ])
11516
11544
  }
11517
11545
  },
11518
11546
  connectGame: async (context, event) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.22",
3
+ "version": "1.1.23",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -17,6 +17,11 @@ export default function (request) {
17
17
  parentCategoryId: null,
18
18
  totalPage: 1,
19
19
  },
20
+ addition: {
21
+ data: [],
22
+ timestamp: null,
23
+ totalPage: 1,
24
+ },
20
25
  // play params
21
26
  game: {
22
27
  providerId: null,
@@ -201,6 +206,11 @@ export default function (request) {
201
206
  parentCategoryId: null,
202
207
  totalPage: 1,
203
208
  },
209
+ addition: {
210
+ data: [],
211
+ timestamp: null,
212
+ totalPage: 1,
213
+ },
204
214
  }
205
215
  }),
206
216
  appendContent: assign((context, event) => {
@@ -208,23 +218,31 @@ export default function (request) {
208
218
  if (room.categoryId === GAME_SEARCH) {
209
219
  return
210
220
  } else {
211
- const { data, ...rest } = event.data
221
+ const [content, addition] = event.data
212
222
  return {
213
223
  content: {
214
224
  ...context.content,
215
- ...rest,
216
- data: context.content.data.concat(data),
225
+ ...content,
226
+ data: context.content.data.concat(content.data),
227
+ },
228
+ addition: {
229
+ ...context.addition,
230
+ ...addition,
231
+ data: context.addition.data.concat(addition.data),
217
232
  },
218
233
  }
219
234
  }
220
235
  }),
221
236
  swapContent: assign((context, event) => {
222
- const item = event.data
223
- if (item?.data?.length) {
224
- return {
225
- content: event.data,
226
- }
237
+ const [content, addition] = event.data
238
+ let result = {}
239
+ if (content?.data?.length) {
240
+ result.content = content
241
+ }
242
+ if (addition?.data?.length) {
243
+ result.addition = addition
227
244
  }
245
+ return result
228
246
  }),
229
247
  increaseIndex: assign((context, event) => {
230
248
  return {
@@ -261,7 +279,8 @@ export default function (request) {
261
279
  if (room.categoryId === GAME_SEARCH) {
262
280
  return
263
281
  } else {
264
- return await request.send(api.getListCategory({ categoryId: room.categoryId, index }))
282
+ const param = { categoryId: room.categoryId, index }
283
+ return await Promise.all([request.send(api.getListCategory(param)), request.send(api.getListAddition(param))])
265
284
  }
266
285
  },
267
286
  updatePageContent: async (context, event) => {
@@ -269,13 +288,22 @@ export default function (request) {
269
288
  if (room.categoryId === GAME_SEARCH) {
270
289
  return
271
290
  } else {
272
- return await request.send(
273
- api.getListCategoryByRange({
274
- categoryId: room.categoryId,
275
- end: index,
276
- timestamp: content.timestamp,
277
- })
278
- )
291
+ return await Promise.all([
292
+ request.send(
293
+ api.getListCategoryByRange({
294
+ categoryId: room.categoryId,
295
+ end: index,
296
+ timestamp: content.timestamp,
297
+ })
298
+ ),
299
+ request.send(
300
+ api.getListAdditionByRange({
301
+ categoryId: room.categoryId,
302
+ end: index,
303
+ timestamp: content.timestamp,
304
+ })
305
+ ),
306
+ ])
279
307
  }
280
308
  },
281
309
  connectGame: async (context, event) => {