0.0.12 • Published 7 years ago
udoit v0.0.12
udoit
Tiny functional reactive state library
Installation
npm install udoit --save
yarn add udoit
Usage
TypeScript
import { observable, doTransaction, DoContext } from 'udoit';
class SimpleModel {
@observable firstName: String;
@observable lastName: String;
}
const model = new SimpleModel();
const ctx = new DoContext();
doTransaction(()=>{
model.firstName = "Bob";
model.lastName = "Surname";
});
ctx.do(()=>{
console.log(model.firstName + " " + model.lastName);
});
doTransaction(()=>{
model.firstName = "Mary";
});