Neural Processing Mechanisms

    giao-hook
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    usage

    import React, { useEffect, useState } from 'react'
    import { useAsyncGetState } from 'giao-hook' 
    
    function App() {
      const [count1, setCount1, getCount1] = useAsyncGetState(10)
      const [count2, setCount2] = useState(0)
    
      async function changeCount1() {
        await setCount1(count1 + 1)
      }
      function changeCount2() {
        setCount2(getCount1() * 10)
      }
    
      useEffect(() => {
        changeCount1()
        changeCount2()
      }, [])
    
      return (
        <div> 
          <h2>count1: { count1 }</h2>
          <h2>count2: { count2 }</h2> 
        </div>
      );
    }
    
    export default App;

    Install

    npm i giao-hook

    DownloadsWeekly Downloads

    0

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    3.21 kB

    Total Files

    4

    Last publish

    Collaborators

    • vear