NISHIO Hirokazu[Translate]
ReactNを露出する
2021-06-28
グローバルな値を自分で管理する必要はない、ReactNに任せれば良い
値の読み書きのためのインターフェイスだけ露出すれば良い

以前の議論

ts
import { getGlobal, setGlobal } from "reactn"; const movidea = { setGlobal, getGlobal, }; const debug = {}; declare global { interface Window { debug: any; movidea: typeof movidea; } } export const initializeGlobalVariables = () => { window.movidea = movidea; window.debug = debug; };


"Engineer's way of creating knowledge" the English version of my book is now available on [Engineer's way of creating knowledge]

(C)NISHIO Hirokazu / Converted from [Scrapbox] at [Edit]