Record and Replay your events in the browser.
npm install --save git+https://github.com/Eskalol/DOMReplay.git#dist
# or
yarn add git+https://github.com/Eskalol/DOMReplay.git#dist
Tip: Clear local storage when playing around with the framework.
domreplay.initialize() has to be called after the registry has been populated.
import DomReplay, { Hud, Registry, events } from 'domreplay';
// Populate the registry.
Registry.registerEvent(new events.ClickEvent());
Registry.registerEvent(new events.InputEvent());
// create the dom replay instance and initialize it.
const domreplay = new DomReplay({debugmode: true});
domreplay.initialize();
// If you also want to render the shipped hud.
const hud = new Hud(domreplay, {showRecordIndicator: true, showReplayIndicator: true});
hud.render();
If you also need the hud you should also import the styles.
@import '../node_modules/domreplay/dist/styles.css';