User Loyalty

May 18th 16

Test Facebook’s Doomsday scenario against your users to determine their loyalty to your application.

It prevents users accessing your application by disabling XMLHttpRequests (AJAX). The test can be stopped and you can see how many times the user tried to access your application.

Usage

import UserLoyalty from 'user-loyalty'

UserLoyalty.start()

location.reload()

UserLoyalty.stop()

console.log(UserLoyalty.results())

API

UserLoyalty.start()

Prevents off XMLHttpRequests and begins logging the number of times the application is refreshed. Clears any statistics held about the user.

UserLoyalty.stop()

Re-enables XMLHttpRequests.

UserLoyalty.statistics()

Returns the number of times the application had been refreshed during the testing scenario.

UserLoyalty.active()

Returns whether testing scenario is currently in progress.

Installation

npm install user-loyalty --save

Source is here

Lib Starter

Next