@pacote/immutable
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

@pacote/immutable

version minified minified + gzip

Generic type for deeply immutable data.

Installation

yarn add @pacote/immutable

Usage

import { Immutable } from '@pacote/immutable'

type Foo = { foo: string }

const mutable: Foo[] = [{ foo: 'bar' }]

// Allowed:
mutable.push({ foo: 'baz' })
mutable[0].foo = 'baz'
delete mutable[0].foo

const immutable: Immutable<Foo[]> = [{ foo: 'bar' }]

// Not allowed:
immutable.push({ foo: 'baz' })
immutable[0].foo = 'baz'
delete immutable[0].foo

License

MIT © Luís Rodrigues.

Readme

Keywords

Package Sidebar

Install

npm i @pacote/immutable

Weekly Downloads

4

Version

2.0.1

License

MIT

Unpacked Size

7.43 kB

Total Files

12

Last publish

Collaborators

  • goblindegook