0.1.3 • Published 4 years ago

rve v0.1.3

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

rve

React mixed Vue 3.0 API with type safety

NPM

INSTALL

npm install rve --save

USAGE

import React from 'react'
import { value, useState, useEffect, render } from 'rve'

function App() {
  const count = value(0)

  const state = useState({
    user: {
      name: 'yetone',
    },
    a: {
      b: {
        c: {
          d: 0,
        }
      }
    }
  })

  const incr = () => count.value++

  useEffect(() => {
    document.title = `${state.user.name} clicked ${count.value} times`
  })

  return (
    <div>
      <p>{state.user.name} clicked {state.count} times</p>
      <p>a.b.c.d is {state.a.b.c.d}</p>
      <input type="text" value={state.user.name} onChange={e => state.user.name = e.target.value} />
      <input type="text" value={state.a.b.c.d} onChange={e => state.a.b.c.d = e.target.value} />
      <button onClick={() => state.a.b = {c: {d: 233}}}>Reset a.b</button>
      <button onClick={incr}>Click me</button>
    </div>
  )
}

render(<App />, document.getElementById('app'))
0.1.3

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago