0.3.1 • Published 6 years ago

@uqee/immutability-helper-x v0.3.1

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

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 functionDescriptionExample
arrayDeleteRemove items from an arrayupdate([1, 2, 3], { $pop: [1, 3] }) -> [2]
arrayPushUniquePush items to a unique-items arrayupdate([1, 2, 3], { $pushuniq: [2, 3, 4] }) -> [1, 2, 3, 4]
objectDeleteRemove keys form an objectupdate({ foo: 1, bar: 2 }, { $del: ['bar', 'baz'] }) -> { foo: 1 }
0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago