JSPM

ko.revertibleobservable

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 4
    • Score
      100M100P100Q25952F
    • License ISC

    knockout revertible observable

    Package Exports

    • ko.revertibleobservable

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ko.revertibleobservable) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Summary

    Knockout revertible observable extension based on Revertible Observables in Knockout

    Usage

    var ko = require('knockout');
    var koExtensions = require('ko.revertibleobservable');
    
    ko.revertibleObservable = koExtensions.revertibleObservable;
    var data = {
        FrontEnd: ko.revertibleObservable("Angular"),
        Backend: ko.revertibleObservable("NodeJs"),
    }
    console.log(data.FrontEnd());
    
    data.FrontEnd('React');
    data.FrontEnd('Knockout');
    data.FrontEnd.reset();
    console.log(data.FrontEnd()); //Resets to Angular
    
    data.FrontEnd('React');
    data.FrontEnd.commit(); //Commit changes the value to React
    console.log(data.FrontEnd());

    License

    Apache 2.0