chore: remove property correct
This commit is contained in:
@@ -248,10 +248,8 @@ export const getRecastItemValue = (block: RecastItem | AsyncBlock) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const removeValue = (propertyId: RecastPropertyId) => {
|
const removeValue = (propertyId: RecastPropertyId) => {
|
||||||
return recastItem.setProperty(TABLE_VALUES_KEY, {
|
const { [propertyId]: omitted, ...restProps } = props;
|
||||||
...props,
|
return recastItem.setProperty(TABLE_VALUES_KEY, restProps);
|
||||||
[propertyId]: null,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
return { getAllValue, getValue, setValue, removeValue };
|
return { getAllValue, getValue, setValue, removeValue };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ type VariantBlock<Props> = Omit<
|
|||||||
value: Props[T]
|
value: Props[T]
|
||||||
): Promise<boolean>;
|
): Promise<boolean>;
|
||||||
setProperties(value: Partial<Props>): Promise<boolean>;
|
setProperties(value: Partial<Props>): Promise<boolean>;
|
||||||
|
removeProperty<T extends keyof Props>(key: T): Promise<boolean>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RecastBlock = VariantBlock<RecastDataProperties>;
|
export type RecastBlock = VariantBlock<RecastDataProperties>;
|
||||||
|
|||||||
Reference in New Issue
Block a user