Closed fantasticsoul closed 1 year ago
代码如下( 可访问 https://tnfe.github.io/limu/ 打开console复制并回车运行 )
// const { createDraft, finishDraft } = immer; // immer 结果ok const { createDraft, finishDraft } = limu; // limu 结果不正常 const base = { list: [ {name:1}, {name:2} ], map: {}, }; const draft = createDraft(base, { onOperate: console.log }); const map = {}; draft.list.forEach(item=>{ map[item.name] = item; }); draft.map = map; const final = finishDraft(draft); console.log('base', base); console.log('final', final);
limu 结果:
immer 结果:
已修复,见版本 3.7.0
代码如下( 可访问 https://tnfe.github.io/limu/ 打开console复制并回车运行 )
limu 结果:
immer 结果: