mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
[Docs] Fix example in doc comment (#2804)
This commit is contained in:
@@ -3,11 +3,12 @@
|
|||||||
* Does not observe deep changes.
|
* Does not observe deep changes.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* const { get, set } = useValueTransform<ResultItem[], string[]>(
|
* const transformFunction = (items: string[]) => items.map(item => `root/${item}.ext`)
|
||||||
* items => items.map(formatPath)
|
* const { get, set } = useValueTransform(transformFunction, [])
|
||||||
* )
|
|
||||||
*
|
|
||||||
* Object.defineProperty(obj, 'value', { get, set })
|
* Object.defineProperty(obj, 'value', { get, set })
|
||||||
|
*
|
||||||
|
* obj.value = ['filename1', 'filename2']
|
||||||
|
* console.log(obj.value) // ["root/filename1.ext", "root/filename2.ext"]
|
||||||
*/
|
*/
|
||||||
export function useValueTransform<Internal, External>(
|
export function useValueTransform<Internal, External>(
|
||||||
transform: (value: Internal) => External,
|
transform: (value: Internal) => External,
|
||||||
|
|||||||
Reference in New Issue
Block a user