add (commented out) instructions how to use record/replay

This commit is contained in:
Bruno Windels 2019-12-23 14:29:19 +01:00
parent eb34fc4ef6
commit 29b531ae80

View file

@ -1,4 +1,5 @@
import HomeServerApi from "./matrix/hs-api.js";
// import {RecordRequester, ReplayRequester} from "./matrix/net/replay.js";
import fetchRequest from "./matrix/net/fetch.js";
import StorageFactory from "./matrix/storage/idb/create.js";
import SessionsStore from "./matrix/sessions-store/localstorage/SessionsStore.js";
@ -7,6 +8,17 @@ import BrawlView from "./ui/web/BrawlView.js";
export default async function main(container) {
try {
// to replay:
// const fetchLog = await (await fetch("/fetchlogs/constrainterror.json")).json();
// const replay = new ReplayRequester(fetchLog, {delay: false});
// const request = replay.request;
// to record:
// const recorder = new RecordRequester(fetchRequest);
// const request = recorder.request;
// window.getBrawlFetchLog = () => recorder.log();
// normal network:
const request = fetchRequest;
const vm = new BrawlViewModel({
storageFactory: new StorageFactory(),