xstate has a similar mechanism for restoring state from defined state schema which on the surface seems similar