@lancom/shared 0.0.109 → 0.0.110

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.
@@ -1,10 +1,16 @@
1
1
  import { mapGetters, mapActions, mapMutations } from 'vuex';
2
2
  import confirmModal from '@lancom/shared/mixins/confirm';
3
+ import debounce from 'lodash.debounce';
3
4
 
4
5
  export default {
5
6
  mixins: [
6
7
  confirmModal
7
8
  ],
9
+ data() {
10
+ return {
11
+ calculateCartPriceWithDebounce: debounce(this.calculateCartPrice, 300)
12
+ };
13
+ },
8
14
  computed: {
9
15
  ...mapGetters(['shop']),
10
16
  ...mapGetters('auth', ['user']),
@@ -29,11 +35,11 @@ export default {
29
35
  },
30
36
  watch: {
31
37
  entities() {
32
- this.calculateCartPrice({ shop: this.shop });
38
+ this.calculateCartPriceWithDebounce({ shop: this.shop });
33
39
  }
34
40
  },
35
41
  mounted() {
36
- this.calculateCartPrice({ shop: this.shop });
42
+ this.calculateCartPriceWithDebounce({ shop: this.shop });
37
43
  if (!this.suburb && this.user?.suburb) {
38
44
  this.handleSuburbChange(this.user.suburb);
39
45
  }
@@ -82,7 +82,7 @@ export default {
82
82
  const message = `Maximum value: ${this.simpleProduct.quantityStock}`;
83
83
  this.showConfirmationModal(message);
84
84
  }
85
- this.setSimpleProductAmountWithDebounce({
85
+ this.setSimpleProductAmount({
86
86
  guid: this.simpleProduct.guid,
87
87
  amount: this.formatAmount(value),
88
88
  shop: this.shop
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.109",
3
+ "version": "0.0.110",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {