glass-easel-miniprogram-adapter 0.9.0 → 0.10.1

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.
@@ -43,6 +43,7 @@ export class BehaviorBuilder<
43
43
  TExtraThisFields
44
44
  > {
45
45
  private _$definitionFilter: DefinitionFilter | undefined
46
+ private _$chainingFilter?: ChainingFilterFunc<any, any>
46
47
 
47
48
  /** @internal */
48
49
  static create(codeSpace: CodeSpace): BehaviorBuilder {
@@ -74,7 +75,7 @@ export class BehaviorBuilder<
74
75
  >,
75
76
  TChainingFilter
76
77
  > {
77
- this._$.chainingFilter(func as any)
78
+ this._$chainingFilter = func
78
79
  return this as any
79
80
  }
80
81
 
@@ -103,6 +104,9 @@ export class BehaviorBuilder<
103
104
  this._$parents.push(behavior as GeneralBehavior)
104
105
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
105
106
  this._$ = this._$.behavior(behavior._$)
107
+ if (behavior._$chainingFilter) {
108
+ return behavior._$chainingFilter(this as any)
109
+ }
106
110
  return this as any
107
111
  }
108
112
 
@@ -284,6 +288,7 @@ export class BehaviorBuilder<
284
288
  this._$.registerBehavior(),
285
289
  this._$parents,
286
290
  this._$definitionFilter,
291
+ this._$chainingFilter,
287
292
  this._$export,
288
293
  )
289
294
  }
@@ -125,6 +125,9 @@ export class ComponentBuilder<
125
125
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
126
126
  this._$export = behavior._$export as any
127
127
  }
128
+ if (behavior._$chainingFilter) {
129
+ return behavior._$chainingFilter(this as any)
130
+ }
128
131
  return this as any
129
132
  }
130
133
 
@@ -753,7 +753,7 @@ describe('define', () => {
753
753
  .chainingFilter<TAdd, TRemove>((chain) => {
754
754
  const oldData = chain.data.bind(chain)
755
755
  const newData = function () {
756
- oldData(() => ({
756
+ return oldData(() => ({
757
757
  a: 123,
758
758
  }))
759
759
  }