mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-25 06:24:27 +08:00
10 lines
371 B
TypeScript
10 lines
371 B
TypeScript
// A shared instance exported from one member of an import cycle and read
|
|
// through a function of the other member. inventory.ts evaluates after
|
|
// report.ts, so report's function only runs once `stock` initialized.
|
|
import { stock } from "./inventory.ts";
|
|
import { summary } from "./report.ts";
|
|
|
|
stock.add("bolt", 4);
|
|
console.log(summary());
|
|
console.log(stock.count());
|