@headlineradmin/escape-webkit
v1.0.26
Published
EscapeTech frontend internal utility tool
Downloads
46
Readme
escape-webkit
Hooks
useDebounce
useDebounce(value: T, delay?: number): T;
const [counter, setCounter] = useState(0);
cosnt debouncedCounter = useDebounce(counter, 1000);
useUserMedia
useUserMedia(constraints: MediaStreamConstraints, onError: (e: string) => void): MediaStream;
https://github.com/default34/typescript-navigator-usermedia-react-hook/blob/main/src/App.tsx
Utils
clone
Returns a deep copy of the source.
clone<T>(arg: T): T;
const objects = [{ 'a': 1 }, { 'b': 2 }];
const deepClone = clone(objects);
console.log(deepClone[0] === objects[0]); // => false
omit
Returns a partial copy of an object omitting the keys specified.
omit<T extends object, K extends readonly string[]>(obj: T, keys: K): Omit<T, Exclude<keyof T, K>>;
omit({a: 1, b: 2, c: 3, d: 4}, ['a', 'd']); //=> {b: 2, c: 3}