@uqee/immutability-helper-x
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

What

Additional functions for the immutability-helper tool.

Getting started

  1. Install
yarn add @uqee/immutability-helper-x
  1. Test
yarn test
  1. Use
import update from 'immutability-helper';
import {
  arrayDelete,
  arrayPushUnique,
  objectDelete,
} from '@uqee/immutability-helper-x';

update.extend('$pop', arrayDelete);
update.extend('$pushuniq', arrayPushUnique);
update.extend('$del', objectDelete);

Reference

Exported function Description Example
arrayDelete Remove items from an array update([1, 2, 3], { $pop: [1, 3] }) -> [2]
arrayPushUnique Push items to a unique-items array update([1, 2, 3], { $pushuniq: [2, 3, 4] }) -> [1, 2, 3, 4]
objectDelete Remove keys form an object update({ foo: 1, bar: 2 }, { $del: ['bar', 'baz'] }) -> { foo: 1 }

Dependencies (0)

    Dev Dependencies (9)

    Package Sidebar

    Install

    npm i @uqee/immutability-helper-x

    Weekly Downloads

    7

    Version

    0.3.1

    License

    MIT

    Unpacked Size

    128 kB

    Total Files

    12

    Last publish

    Collaborators

    • uqee