* Safely read an atom value, returning null if the atom is null.
(atom: Atom<T>)
| 346 | * Safely read an atom value, returning null if the atom is null. |
| 347 | */ |
| 348 | function readAtom<T>(atom: Atom<T>): T { |
| 349 | if (atom == null) { |
| 350 | return null; |
| 351 | } |
| 352 | return globalStore.get(atom); |
| 353 | } |
| 354 | |
| 355 | /** |
| 356 | * Get the preload api. |