Based on API docs and ts definitions.
Depends on D6993
Differential D7101
[web-db] add `sql.js` types kamil on Mar 20 2023, 9:06 AM. Authored by Tags None Referenced Files
Details
Based on API docs and ts definitions. Depends on D6993 yarn flow check
Diff Detail
Event TimelineComment Actions I've left some inline comments about the types themselves. More general notes:
Comment Actions address review
|
You don't need to use React.useMemo(...) here.
The useMemo() hook is helpful for maintaining referential equality so that objects will be considered "shallowly equal" (== in JS) and we can avoid re-renders. This is helpful for objects (including Map(), Set(), etc), arrays (which are objects), and functions (which are objects).
On the other hand, strings in JS are considered shallowly equal if they have the same contents, so we don't have to worry about re-renders if the "content" stays the same.
See below:
(In like C++, which you've been working w/ recently, std::strings can be allocated on the heap (unlike integers, booleans, etc) which may have been part of your reasoning that shallow equality would check reference instead of contents?)