import { Atom } from '@theatre/dataverse' ; import type { Store } from 'redux' ; export default function atomFromReduxStore < State > ( store ) { let lastState = store . getState ( ) ; const a = new Atom < State > ( lastState ) ; store . subscribe ( ( ) => { const newState = store . getState ( ) ; a . setState ( newState ) ; lastState = newState ; } ) ; return a ; }