percentage-incrementor
Store the percentage of an incrementing subset against a total.
Installation
yarn add percentage-incrementor
or npm i --save percentage-incrementor
Usage
const PercentageIncrementor = ; // Store the percentage of truthy values incremented.const truthyPercent = !!val; // Starts at 0.truthyPercent;// 0 truthyPercent;// 0 truthyPercent;// 0.5 truthyPercent;// 0.666666666 // Use it as a primitive.if truthyPercent > 05 console;// yay!