Skip to content

Commit

Permalink
feat(json-schema): support read scope in x-reactions (#2864)
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang authored Feb 25, 2022
1 parent 5b78f97 commit 25c1264
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/json-schema/src/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const getUserReactions = (
const reaction = shallowCompile(unCompiled, baseScope)
if (!reaction) return
if (isFn(reaction)) {
return reaction(field)
return reaction(field, baseScope)
}
const { when, fulfill, otherwise, target, effects } = reaction
const run = () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/json-schema/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export type SchemaReaction<Field = any> =
}
[key: string]: any
}
| ((field: Field) => void)
| ((field: Field, scope: any) => void)

export type SchemaReactions<Field = any> =
| SchemaReaction<Field>
Expand Down

0 comments on commit 25c1264

Please sign in to comment.