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
| Name | Type | Default | Note |
|---|---|---|---|
| obj | object | - | - Object part of the returned value |
| arr | Array | - | - Iterable tuple/array part of the returned value |
Returns
object & Array
Source
Source • DemoContributors
D