From dc55f580049d284c6e01271e3885c4fa23a8f458 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 19 Jul 2022 15:37:24 -0500 Subject: Replace mobx-state-tree with mobx and get a basic home feed rendering --- src/state/lib/type-guards.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/state/lib/type-guards.ts (limited to 'src/state/lib/type-guards.ts') diff --git a/src/state/lib/type-guards.ts b/src/state/lib/type-guards.ts new file mode 100644 index 000000000..4ae31f3ac --- /dev/null +++ b/src/state/lib/type-guards.ts @@ -0,0 +1,10 @@ +export function isObj(v: unknown): v is Record { + return !!v && typeof v === 'object' +} + +export function hasProp( + data: object, + prop: K, +): data is Record { + return prop in data +} -- cgit 1.4.1