Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including active-data with all npm packages installed. Try it out:

const ad = require("active-data"); ad.setOptions({ immediateReaction: true, // make recalculations for each change }); const data = ad.makeObservable({ welcomeMessage: "Hello,", firstName: "Luke", lastName: "Skywalker", }); ad.makeComputed(data, "fullName", self => `${self.firstName} ${self.lastName}`); ad.makeReaction(() => { console.log(data.welcomeMessage + " " + data.fullName); }); // "Hello, Luke Skywalker" will be printed immediately (can be configured) data.firstName = "Leia"; // will print "Hello, Leia Skywalker" ad.run(() => { // group changes together and run reaction functions only at the end data.firstName = "Anakin"; data.welcomeMessage = "Welcome to dark side,"; });

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

active-data v2.0.10

Reactive data manager, inspired by MobX. Automatically detects associated data and perform updates to your views or everything dependent on that data when it changes. Implemented with js Proxy objects

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free