immutability-helper

  • Version 3.1.1
  • Published
  • 28.8 kB
  • No dependencies
  • MIT license

Install

npm i immutability-helper
yarn add immutability-helper
pnpm add immutability-helper

Overview

mutate a copy of data without changing the original source

Index

Variables

variable isEquals

const isEquals: any;

    Functions

    function _default

    _default: <T, C extends CustomCommands<object> = never>(
    object: T,
    $spec: Spec<T, C>
    ) => T;

      function extend

      extend: <T>(directive: string, fn: (param: any, old: T) => T) => void;

        function invariant

        invariant: (condition: boolean, message: () => string) => void;

          Classes

          class Context

          class Context {}

            constructor

            constructor();

              property isEquals

              isEquals: (x: any, y: any) => boolean;

                method extend

                extend: <T>(directive: string, fn: (param: any, old: T) => T) => void;

                  method update

                  update: <T, C extends CustomCommands<object> = never>(
                  object: T,
                  $spec: Spec<T, C>
                  ) => T;

                    Type Aliases

                    type CustomCommands

                    type CustomCommands<T> = T & {
                    __noInferenceCustomCommandsBrand: any;
                    };

                      type Spec

                      type Spec<T, C extends CustomCommands<object> = never> =
                      | (T extends Array<infer U> | ReadonlyArray<infer U>
                      ? ArraySpec<U, C>
                      : T extends Map<infer K, infer V> | ReadonlyMap<infer K, infer V>
                      ? MapSpec<K, V, C>
                      : T extends Set<infer X> | ReadonlySet<infer X>
                      ? SetSpec<X>
                      : T extends object
                      ? ObjectSpec<T, C>
                      : never)
                      | {
                      $set: T;
                      }
                      | {
                      $apply: (v: T) => T;
                      }
                      | ((v: T) => T)
                      | (C extends CustomCommands<infer O> ? O : never);

                        Package Files (1)

                        Dependencies (0)

                        No dependencies.

                        Dev Dependencies (8)

                        Peer Dependencies (0)

                        No peer dependencies.

                        Badge

                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/immutability-helper.

                        • Markdown
                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/immutability-helper)
                        • HTML
                          <a href="https://www.jsdocs.io/package/immutability-helper"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>