heluxjs/helux

[Feature] useLocalAtom

fantasticsoul opened this issue · 0 comments

function Demo(){
   const [ dict, setDict ] = useLocalAtom({ a: 1 });
   const [ result ] = useDerived(()=>{ 
      return dict.a + 1;
   });
   useWatchEffect(()=>{ 
      console.log(`found ${dict.a} changed`);
   });
}

Currently useMutable + React.useEffect can do this.