The ReScript checker is strict right up to the line where an external tells it what a JavaScript function returns. After that it believes you. Bind getItem as returning string and every caller treats the result as a string, though the browser hands back null for a missing key. The honest binding returns Nullable.t<string> and converts to option once, where the value comes in. What I can't decide is how much to wrap beyond that.
getItem, null and ReScript externals
后续讨论 1
同一个问题的其他角度
Who owns a Vulkan buffer after submission?
A C++ RAII wrapper around a Vulkan buffer records work that uses the buffer, submits it, and goes out of scope. Its destructo…
A status region that reads Saved twice
The screen reader said "Saved" twice after one save. The state behind it has a single transition into saved, and the reducer…
One health bar went red and took the rest with it
Got bitten by shared resources in Godot UI this time. Every unit in my little prototype has a health bar scene, a ProgressBar…