2016-08-02 10:55:23 -04:00
2016-08-01 01:22:01 -04:00
2016-08-02 10:55:23 -04:00
2016-08-02 10:55:23 -04:00
2016-08-02 10:55:23 -04:00
2016-08-01 01:42:57 -04:00
2016-08-02 10:55:23 -04:00
2016-08-01 01:37:20 -04:00

update-immutable

Features

This is a re-implementation of react's update function with the following differences:

  • Simple recursive implementation without dependencies The original version depends on react.

  • Implements $unset The react team refuses to merge this functionality for some pretty dubious reasons. $unset is important for several use-cases.

  • unshift doesn't reverse The react version of $unshift unshifts each element in a loop, thereby reversing the provided list. This version fixes that bug and makes it work like perl's unshift.

  • Supports auto-vivification Auto-vivification allows you to modify a nested data structure even if the nesting data-structures don't yet exist. They will be created so as to satisfy the update. This simplifies many use-cases, for example you don't need to maintain an initial-state skeleton.

Server-side

There is a companion perl module Update::Immutable that implements functionality identical to this module. This lets you process updates both server-side and on the client (provided your server is implemented in perl that is).

(C) 2016 Doug Hoyte

2-clause BSD license

Description
No description provided
Readme 37 KiB
Languages
JavaScript 100%