proxy-vir
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

proxy-vir

Creates a proxy based on multiple dynamically cascaded targets (meaning you can add or remove targets whenever you want) with dynamic proxy handler overriding (meaning you can modify how proxy handlers operate after the proxy has been created).

Installation

npm i proxy-vir

Usages

Simple override

import {createWrappedMultiTargetProxy} from 'proxy-vir';

// something you imported from a 3rd party library that you want to wrap
const importedThing = {
    doThingA() {},
};

const thingWrapper = createWrappedMultiTargetProxy({
    initialTarget: importedThing,
});

// add a new override
thingWrapper.proxyModifier.addOverrideTarget({
    doThingA() {},
});

Readme

Keywords

Package Sidebar

Install

npm i proxy-vir

Weekly Downloads

44,081

Version

2.0.1

License

(MIT or CC0 1.0)

Unpacked Size

28.4 kB

Total Files

10

Last publish

Collaborators

  • electrovir