chore: remove property correct

This commit is contained in:
lawvs 2022-07-27 16:12:54 +08:00
parent 91781b4d75
commit 29d5a8c971
2 changed files with 3 additions and 4 deletions

View File

@ -248,10 +248,8 @@ export const getRecastItemValue = (block: RecastItem | AsyncBlock) => {
};
const removeValue = (propertyId: RecastPropertyId) => {
return recastItem.setProperty(TABLE_VALUES_KEY, {
...props,
[propertyId]: null,
});
const { [propertyId]: omitted, ...restProps } = props;
return recastItem.setProperty(TABLE_VALUES_KEY, restProps);
};
return { getAllValue, getValue, setValue, removeValue };
};

View File

@ -18,6 +18,7 @@ type VariantBlock<Props> = Omit<
value: Props[T]
): Promise<boolean>;
setProperties(value: Partial<Props>): Promise<boolean>;
removeProperty<T extends keyof Props>(key: T): Promise<boolean>;
};
export type RecastBlock = VariantBlock<RecastDataProperties>;