10
11const reportsTextRE = /^Reports( \(\d+\))?/;
12
13export let staffActions: StaffAction[] = []; 14let staffInfo: StaffInfo = null;
15
16/**
3import { getBooleanStorageVal } from "../storage";
4
5export let $topbar:JQuery<HTMLElement> = null;
6export let topbarHeight = 32; 7
8interface BeforeAfter {
9 before?: any;
2
3import { getBooleanStorageVal } from "../storage";
4
5export let $topbar:JQuery<HTMLElement> = null; 6export let topbarHeight = 32;
7
8interface BeforeAfter {
18import { alertLightbox } from "./lightbox";
19import { addPostDropdown } from "./postdropdown";
20
21export let $qr: JQuery<HTMLElement> = null; 22let threadCooldown = 0;
23let replyCooldown = 0;
24
It is recommended not to mutate a name after exporting it. That is to avoid using mutable variable declarator kinds like let
and var
, which can be mutated even after exporting the name. This creates unexpected results when using the name in the module where it is being imported.
This can be unexpected errors like this.
// <!-- utils.js -->
export let magicNumber = 2
magicNumber = 3
And when using this
// <!-- index.js -->
import { magicNumber } from './utils.js;
console.log(magicNumber) // we might be expecting here the value 2, but it would be 3
// <!-- config.js -->
export let retryLimit = 2 // it is recommended to use `const` instead
// <!-- config.js -->
export const retryLimit = 2