fukubiki
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

fukubiki

sampling without replacement.

Example Usage

yarn add fukubiki
import Fukubiki from 'fukubiki';
 
const fukubiki = new Fukubiki(3);
 
fukubiki.select(); // => 2
fukubiki.select(); // => 0
fukubiki.select(); // => 1
fukubiki.select(); // => null
 
fukubiki.reset();
 
fukubiki.select(); // => 0
fukubiki.select(); // => 2
fukubiki.select(); // => 1
fukubiki.select(); // => null

Option

callback

import Fukubiki from 'fukubiki';
 
const fukubiki = new Fukubiki(3, {
  callback: () => {
      console.log('finish!');
  }
});
 
fukubiki.select(); // => 1
fukubiki.select(); // => 0
fukubiki.select(); // => 2 and 'finish!'

autoReset

import Fukubiki from 'fukubiki';
 
const fukubiki = new Fukubiki(3, {
  autoReset: true
});
 
fukubiki.select(); // => 0
fukubiki.select(); // => 2
fukubiki.select(); // => 1
fukubiki.select(); // => 1
fukubiki.select(); // => 0
fukubiki.select(); // => 2

Package Sidebar

Install

npm i fukubiki

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

4.15 kB

Total Files

5

Last publish

Collaborators

  • kimizuka