react-composable-api
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

react composable api

Lightweight library for creation composable functional components. This lib provide a classic hooks and life cycle actions of composable pattern:


import {ref, watch, onMounted} from 'react-composable-api'

function App() {
    const state = ref('init')
    onMounted(() => {
        state.value = 'mounted'
    })
    watch(state.value, () => {
        console.log(`is changed value: ${state.value}`)
    })
    return <h1 onClick={() => state.value = 'changed'}>Actual value: {state.value}</h1>
}

export default App

work in progress for bested result!

/react-composable-api/

    Package Sidebar

    Install

    npm i react-composable-api

    Weekly Downloads

    15

    Version

    1.3.1

    License

    MIT

    Unpacked Size

    8.24 kB

    Total Files

    5

    Last publish

    Collaborators

    • reactcomposableapi