@mpxjs/core 2.8.27 → 2.8.28-beta.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/core",
3
- "version": "2.8.27",
3
+ "version": "2.8.28-beta.5",
4
4
  "description": "mpx runtime core",
5
5
  "keywords": [
6
6
  "miniprogram",
@@ -47,5 +47,5 @@
47
47
  "url": "https://github.com/didi/mpx/issues"
48
48
  },
49
49
  "sideEffects": false,
50
- "gitHead": "f5b31d1f4f7602f103e5757f910f267d46bb91b1"
50
+ "gitHead": "f415e2d6a1c14b51b2cee6eb654205608f217401"
51
51
  }
package/src/core/proxy.js CHANGED
@@ -183,6 +183,7 @@ export default class MpxProxy {
183
183
  unmounted () {
184
184
  this.callHook(BEFOREUNMOUNT)
185
185
  this.scope?.stop()
186
+ if (this.update) this.update.active = false
186
187
  this.callHook(UNMOUNTED)
187
188
  this.state = UNMOUNTED
188
189
  }
@@ -105,10 +105,10 @@ export class ReactiveEffect {
105
105
  this.pausedState = PausedState.paused
106
106
  }
107
107
 
108
- resume () {
108
+ resume (ignoreDirty = false) {
109
109
  const lastPausedState = this.pausedState
110
110
  this.pausedState = PausedState.resumed
111
- if (lastPausedState === PausedState.dirty) {
111
+ if (!ignoreDirty && lastPausedState === PausedState.dirty) {
112
112
  this.scheduler ? this.scheduler() : this.run()
113
113
  }
114
114
  }
@@ -73,15 +73,15 @@ class EffectScope {
73
73
  }
74
74
  }
75
75
 
76
- resume () {
76
+ resume (ignoreDirty = false) {
77
77
  if (this.active) {
78
78
  let i, l
79
79
  for (i = 0, l = this.effects.length; i < l; i++) {
80
- this.effects[i].resume()
80
+ this.effects[i].resume(ignoreDirty)
81
81
  }
82
82
  if (this.scopes) {
83
83
  for (i = 0, l = this.scopes.length; i < l; i++) {
84
- this.scopes[i].resume()
84
+ this.scopes[i].resume(ignoreDirty)
85
85
  }
86
86
  }
87
87
  }
@@ -99,6 +99,7 @@ export default function getRefsMixin () {
99
99
  createSelectorQuery (...args) {
100
100
  const selectorQuery = envObj.createSelectorQuery(...args)
101
101
  const cbs = []
102
+
102
103
  proxyMethods.forEach((name) => {
103
104
  const originalMethod = selectorQuery[name]
104
105
  selectorQuery[name] = function (cb = noop) {
@@ -38,6 +38,7 @@ const noop = () => {
38
38
  const fixEffectScope = (scope) => {
39
39
  scope.pause = noop
40
40
  scope.resume = noop
41
+ return scope
41
42
  }
42
43
 
43
44
  const effectScope = (detached) => fixEffectScope(vueEffectScope(detached))