[go: up one dir, main page]

@unocode/ab

0.1.1 • Public • Published

UnoCode A/B Testing (UnoAB)


Run A/B tests on your UnoCode Project.

Instalation

You can install UnoAB via npm:

npm install --save @unocode/ab

Usage

import UnoAB from '@unocode/ab';

const ab = new UnoAB();

ab.addTest(() => { console.log('I am test A!'); });
ab.addTest(() => { console.log('I am test B!'); });

ab.run();

ab.hasFired // true
ab.codeFired // returns the function that was executed

Persisting or Not Persisting

By default, UnoAB persists the function call, so only different users will experience different tests. You can disable this (and let user receive a new test on each run) as follows:

import UnoAB from '@unocode/ab';

const ab = new UnoAB({ persist: false });

ab.addTest(() => { console.log('I am test A!'); });
ab.addTest(() => { console.log('I am test B!'); });

ab.run();

Readme

Keywords

Package Sidebar

Install

npm i @unocode/ab

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

4.61 kB

Total Files

4

Last publish

Collaborators

  • jonathandamiani
  • kazzkiq