json-joy
Version:
Collection of libraries for building collaborative editing apps.
38 lines (37 loc) • 1.24 kB
JavaScript
import { ValueSyncStore } from '../../../../util/events/sync-store';
export class DebugState {
enabled = new ValueSyncStore(false);
showSliceOutlines = new ValueSyncStore(true);
showSliceInfo = new ValueSyncStore(true);
showCursorInfo = new ValueSyncStore(true);
toggleDebugMode() {
const { enabled, showSliceOutlines, showSliceInfo, showCursorInfo } = this;
if (!enabled.value) {
enabled.next(true);
showSliceOutlines.next(true);
showSliceInfo.next(true);
showCursorInfo.next(true);
}
else {
if (showSliceOutlines.value) {
showSliceOutlines.next(false);
}
else if (showSliceInfo.value) {
showSliceInfo.next(false);
}
else if (showCursorInfo.value) {
showCursorInfo.next(false);
}
else {
enabled.next(false);
showSliceOutlines.next(true);
showSliceInfo.next(true);
showCursorInfo.next(true);
}
}
}
/** ------------------------------------------- {@link UiLifeCycles} */
start() {
return () => { };
}
}