@jetthai/cuora 1.0.30 → 1.0.32

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,10 @@
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.0.32](https://github.com/jetthai/cuora-module/compare/v1.0.31...v1.0.32) (2021-10-21)
6
+
7
+ ### [1.0.31](https://github.com/jetthai/cuora-module/compare/v1.0.30...v1.0.31) (2021-10-21)
8
+
5
9
  ### [1.0.30](https://github.com/jetthai/cuora-module/compare/v1.0.29...v1.0.30) (2021-10-20)
6
10
 
7
11
  ### [1.0.29](https://github.com/jetthai/cuora-module/compare/v1.0.28...v1.0.29) (2021-10-20)
package/README.md CHANGED
@@ -1,11 +1,19 @@
1
1
  # cuora
2
-
3
- > Intergrate API and Store for game.
2
+ Integrate API and logic by xstate.
4
3
 
5
4
  ## Installation
6
-
7
5
  Add @jetthai/cuora dependency to your project:
8
-
9
6
  ```bash
10
7
  npm install --save @jetthai/cuora
11
8
  ```
9
+
10
+ ## Setup
11
+ Add config in `nuxt.config.js` to support latest ECMAScript.
12
+ ```js
13
+ // nuxt.config.js
14
+ {
15
+ build: {
16
+ transpile: '@jetthai/cuora'
17
+ }
18
+ }
19
+ ```
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "",
5
- "main": "./dist/index.js",
6
- "module": "dist/index.js",
5
+ "main": "./src/index.js",
7
6
  "scripts": {
8
7
  "build": "webpack",
9
8
  "release": "standard-version && git push --follow-tags origin master && npm publish"
package/src/api/common.js CHANGED
@@ -1,4 +1,6 @@
1
1
  export default {
2
2
  getConfig: ({ appSecret }) => ({ url: 'getConfig', method: 'get', params: { appSecret }, isPublic: true }),
3
3
  feeds: ({ appSecret }) => ({ url: 'feeds', method: 'get', params: { appSecret }, isPublic: true }),
4
+ broadcast: () => ({ url: 'broadcast', method: 'get', isPublic: true }),
5
+ getAnnouncements: () => ({ url: 'getAnnouncements', method: 'get', isPublic: true }),
4
6
  }
@@ -151,9 +151,17 @@ export default function (request) {
151
151
  return { currentNetwork: event.data }
152
152
  }),
153
153
  setAmount: assign((context, event) => {
154
- return {
155
- currentAmount: event.data,
154
+ const currentAmount = event.data
155
+
156
+ const properties = {
157
+ currentAmount,
158
+ }
159
+
160
+ if (!currentAmount) {
161
+ properties.calculatedResult = null
156
162
  }
163
+
164
+ return properties
157
165
  }),
158
166
  setCalculatedResult: assign((context, event) => {
159
167
  return {