Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
[fix] setTemplate instantly in usearray (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsPulse authored Apr 4, 2023
1 parent a613f79 commit 939dec1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/component/sugar/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function useArray<T>(
sugar.template = template;
const keys = template.map(v => {
const id = newId();
getManagedSugar(id, options.template).asMounted(s => s.setTemplate(v, mode));
getManagedSugar(id, mode === 'merge' ? { ...options.template, ...v } : v);
return id;
});
setKeys(keys);
Expand Down

0 comments on commit 939dec1

Please sign in to comment.