From 8a3ba8615dbc18b607b260d0e54b933fb3e6bb52 Mon Sep 17 00:00:00 2001 From: Anthony Dubis Date: Thu, 29 Apr 2021 12:03:26 -0700 Subject: [PATCH] Extend Atom's update interface Summary: This help handle updates to objects containing JSONObject type (generates typescript errors around infinite recursion: > Type instantiation is excessively deep and possibly infinite.ts(2589) Reviewed By: mweststrate Differential Revision: D28098502 fbshipit-source-id: a8e7f785b03bce7c8e1c0b355e2eca2e087b1881 --- desktop/flipper-plugin/src/state/atom.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop/flipper-plugin/src/state/atom.tsx b/desktop/flipper-plugin/src/state/atom.tsx index 6f41bfc31..3c07dd0c7 100644 --- a/desktop/flipper-plugin/src/state/atom.tsx +++ b/desktop/flipper-plugin/src/state/atom.tsx @@ -22,6 +22,7 @@ export interface ReadOnlyAtom { export interface Atom extends ReadOnlyAtom { set(newValue: T): void; update(recipe: (draft: Draft) => void): void; + update(recipe: (draft: X) => void): void; } class AtomValue implements Atom, Persistable {