0.0.0-next.3 • Published 3 months ago

impervious v0.0.0-next.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

impervious

A simple and opionated proxy for state management.

What

Why

How

Atomic

Within a call to update any changes you make to the proxy are not applied. We simply record the mutations and apply them in order.

The reasoning behind this is that it is extroadinarily difficult to make a JS proxy truly imitate a JS object. Instead of treading carefully into the uncanny valley we instead acknowledge the proxy can never truly fake the real thing, instead it is a nice affordance to make complex immutable update feel mutable.

An impervious proxy has very predictable and limited behaviour. By way of example, here is a list of things impervious doesn't even try to imitate.

  • If you delete a property from an object, it isn't gone until after the patch is complete
  • If you push an item into a list, it won't be there until after the patch is complete
  • If you call shift you will mutate the list after the patch, but shift will always return the same item within the update.
  • If you assign a property, well you get the idea

Think of the object you are interacting with as a completely immutable frozen object. Any change you make will not be visible within that transaction. But all changes / operations are recorded and are applied naively after the patch is complete.

0.0.0-next.16

3 months ago

0.0.0-next.15

3 months ago

0.0.0-next.14

3 months ago

0.0.0-next.13

3 months ago

0.0.0-next.12

3 months ago

0.0.0-next.9

3 months ago

0.0.0-next.8

3 months ago

0.0.0-next.7

3 months ago

0.0.0-next.6

3 months ago

0.0.0-next.5

3 months ago

0.0.0-next.3

3 months ago