useClipboard

useClipboard copies values in components
Import
import { useClipboard } from '@kubed/hooks;'
Source
View source code
Docs
Edit this page
npm
@kubed/hooks

Usage

useClipboard copies the value in the component.

API

1
function useClipboard(
2
{timeout}?: {timeout?: number}
3
): {copy: (valueToCopy: any) => void, reset: () => void, error: Error, copied: boolean}

Params

ParametersDefault ValueTypeDescription
timeout2000numberThe time delay for event triggering

Result

ParametersDefault ValueTypeDescription
copy-(valueToCopy: any) => voidThe value to be copied
reset-() => voidReset the copied value
error-ErrorAn error when copying a value
copied-booleanWhether the copied value was successful