2.0.0 • Published 5 years ago

@bgfist/weact v2.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

Weact

A Framework For Writing Wechat MiniProgram Like React, And With Typescript

install

npm i @bgfist/weact

hook-style

import { FPage, useState, useEffect } from "@bgfist/weact"

function Demo() {
  const [count, setCount] = useState(0)

  useEffect(() => {
    const timer = setTimeout(() => console.log("timer trigger"), count * 1000)
    return () => clearTimeout(timer)
  }, [count])

  const incrCount = () => setCount(count + 1)
  const decrCount = () => setCount(s => s - 1)

  return {
    count, // data
    incrCount, // method
    decrCount, // method
  }
}

FPage(Demo)

for an elegant writing style, weact will group fields and methods for your return using the typeof operator

All supported hooks are listed below, peek their code annotation for a detail explain:

  • useState
  • useEffect
  • useMemo
  • useRef
  • useReducer
  • usePrevious
  • useThisAsPage
  • useThisAsComp
  • ...

debug

import { debugWeact } from "@bgfist/weact"

debugWeact()
2.0.0

5 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago