Negating Past Mistakes

    gyve

    1.0.1 • Public • Published

    build dependencies npm package vulnerabilities

    Gyve

    Prototypal delegation made simple.

    Installation

    Install the package with npm:

    npm install gyve

    Include it in your project:

    const gyve = require("gyve");

    Documentation

    Given two objects, car (delegatee) and bmw (delegator), use gyve to prototype-chain them:

    const car = {
        start() { ... },
        stop() { ... },
        wheels: 4
    };
     
    const electric = {
        charge() { ... }
    };
     
    // car <-- electric
    const electricCar = gyve(car, electric);

    Since gyve is a curried function, partial application is possible:

    const car = { ... };
     
    const delegateToCar = gyve(car);
     
    const f1 = { ... };
     
    // car <-- f1
    const f1Car = delegateToCar(f1);

    License

    MIT

    Install

    npm i gyve

    DownloadsWeekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    8.74 kB

    Total Files

    10

    Last publish

    Collaborators

    • jakubbarczyk