Skip to main content

New answers tagged

2 votes

Are there any good and modern approaches, to have variables that feel global (no need to pass them around explicitly), yet are local to an instance?

As the experts in this community point out, the solution is obvious: use OOP, enclose the state in objects and live a happy life: import {F} from './f'; ... // myLibrary/index.ts export class ...
Blue Nebula's user avatar

Top 50 recent answers are included