Skip to content

Commit

Permalink
Merge branch 'master' into doc
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyzhong committed Sep 3, 2024
2 parents e8b17c5 + 82b8bf9 commit e70a72a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/helux-core/src/factory/creator/mutateDeep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export function prepareDeepMutate(opts: IPrepareMutateOpts) {
const { forAtom, rawState } = internal;
const mutateCtx = newMutateCtx(setFactoryOpts);
const draftRoot = createDraft(rawState, {
// fix issue https://github.com/heluxjs/helux/issues/166
autoRevoke: false,
customKeys: OP_KEYS,
onOperate: (opParams: IOperateParams) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-core/src/hooks/useMutable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function useMutable<T extends object = PlainObject>(apiCtx: CoreApiCtx, i
const handleState = (partialStateOrCb: Partial<T> | PartialStateCb<T>, prevState: T) => {
let final = null;
if (isFn(partialStateOrCb)) {
// 不自动撤销结束后的草稿 proxy,使用户的闭包了子节点使用的场景不报错,但是此节点在结束草稿后只能读取不能修改(修改时无效的
// 不自动撤销结束后的草稿 proxy,使用户闭包了子节点的使用场景不报错,但是此节点在结束草稿后只能读取不能修改(修改是无效的
const draft = createDraft(prevState, { autoRevoke: false });
const mayPartial = partialStateOrCb(draft);
final = finishDraft(draft);
Expand Down

0 comments on commit e70a72a

Please sign in to comment.