@nkovacevic/chronos

1.0.1 • Public • Published

Chronos - Simple state management

Chronos is a simple state management library written in TypeScript, transpiled to JavaScript with Gulp. After initializing and enabling new Chronos object will start tracking history. Because object tracks its history you can take undo and redo actions on it.

USAGE

You can see the example in demo folder of this repository!

Code example:

npm i @nkovacevic/chronos
const Chronos = require('@nkovacevic/chronos');
const chrono = new Chronos();

chrono.enable();

chrono.test = 'TEST';
chrono.test = 'NEW TEST';

console.log(chrono.test); // should be NEW TEST
chrono.undo();
console.log(chrono.test); // should be TEST
chrono.redo();
console.log(chrono.test); // should be NEW TEST
chrono.undo();
console.log(chrono.test); // should be TEST

chrono.disable();

DEVELOPMENT

Chronos uses nodemon, jest and gulp for fast developing.

Make a change in your file and instantanously see your updates!

make sure you run npm ci before running these commands

Open your favorite Terminal and run these commands.

First Tab:

nodemon demo

Second Tab:

jest --watchAll --verbose

Third Tab:

gulp

Chronos uses following dev dependencies:

DEV DEPENDENCY WHAT IS IT? PACKAGE URL
JEST JavaScript testing solution jest
NODEMON automatically restart application when file changes in the directory are detected nodemon
DEL Delete files and folders del
GULP Automate and enhance your workflow gulp
GULP PLUMBER Prevent pipe breaking caused by errors from gulp plugins plumber
GULP SOURCEMAPS Inline source maps sourcemaps
GULP TYPESCRIPT A gulp plugin for handling TypeScript compilation workflow gulp typescript
GULP UGLIFY Minify JavaScript with UglifyJS3 uglify
TSLINT TSLint is an extensible static analysis tool that checks TypeScript code tslint
TYPESCRIPT TypeScript is a language for application-scale JavaScript typescript

LICENSE

MIT License LICENSE

AUTHOR

Nikola Kovacevic

Created on January 2019

Readme

Keywords

none

Package Sidebar

Install

npm i @nkovacevic/chronos

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

46.2 kB

Total Files

18

Last publish

Collaborators

  • nkovacevic