Skip to content

makeDestructurable

Makes an object also iterable for array-style destructuring

helpers
low
test coverage
Last changed: 5 days ago

Installation

Library
CLI
Manual
typescript
import { makeDestructurable } from '@siberiacancode/reactuse';

Usage

typescript
const result = makeDestructurable({ x: 10, y: 20 }, [10, 20] as const);

Demo

Api

Parameters

NameTypeDefaultNote
objobject-- Object part of the returned value
arrArray-- Iterable tuple/array part of the returned value

Returns

object & Array

Source

SourceDemo

Contributors

D
debabin
debabin

Released under the MIT License.