How to keep React state and db in sync with each other - Theo's Typesafe Cult