0.9.42 • Published 8 years ago

dep_counter v0.9.42

Weekly downloads
1
License
GPL-2.0
Repository
github
Last release
8 years ago

DepCounter ( dep_counter)

Version 0.9.42 BETA

DepCounter is a simple tool to provide a countdown of fulfilled dependencies.

It is useful for tracking things like number of files to load or parameters remaining to be set.

DepCounter only counts the dependencies marked as fulfilled and those remaining.

If you want something to track dependencies by name, please try...
NamedDepCounter

If you want to see coding docs, look into...
docs

Install:

    npm install dep_counter;

QuickStart:

	import DepCounter from 'dep_counter';
	const depCounter = new DepCounter('depCounterName');
	
    depCounter.count(3);
	console.log(depCounter.ready()); // false;
	console.log(depCounter.current()); // 3
		
	depCounter.mark(); 
	console.log(depCounter.ready()); // false;
    console.log(depCounter.current()); // 2

    depCounter.mark(); 
    console.log(depCounter.ready()); // false;
    console.log(depCounter.current()); // 1

    depCounter.mark(); 
    console.log(depCounter.ready()); // true;
    console.log(depCounter.current()); // 0

    depCounter.reset();
    console.log(depCounter.ready()); // false;
    console.log(depCounter.current()); // 3   

Add some callbacks

    import DepCounter from 'dep-counter';
    const depCounter = new DepCounter('depCounterName');
    depCounter.count(3);
    depCounter.onComplete((depCounter)=>console.log('DONE', depCounter.ready()));
    depCounter.onMark((depCounter)=>console.log(`Mark! ${depCounter.current()}))

    depCounter.mark();  // Mark! 2
    depCounter.mark();  // Mark! 1
    depCounter.mark();  // Mark! 0 // DONE

    
0.9.42

8 years ago

0.9.4

8 years ago

0.9.3

8 years ago

0.9.2

8 years ago

0.0.91

8 years ago

0.0.9

8 years ago

0.0.35

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.17

10 years ago

0.0.16

10 years ago

0.0.15

10 years ago

0.0.1

10 years ago