Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

impervious

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

impervious

⛅ A little template for writing simple libraries with typescript.

latest
Source
npmnpm
Version
0.0.0-next.3
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 29 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts