voe

> Double thread framework has the same API with Vue

Usage no npm install needed!

<script type="module">
  import voe from 'https://cdn.skypack.dev/voe';
</script>

README

voe logo

Voe npm-v

:jack_o_lantern: Double thread javascript framework has the same API with Vue3.

Introduction

voe (发音 /vəʊ/) 的双线程是小程序的底层架构,它通过 web-worker 隔离 web 环境,屏蔽 dom 能力,从而做到绝对的控制力

顺便实现了 vue3 的响应式,依赖收集,状态更新等,但本质不同

Use

yarn add voe
import { render, h, reactive } from '../src'

function App (props) {
  const state = reactive({ count: 0 })
  return () => (
    <view>
      <text>{state.count}</text>
      <button onClick={e => state.count++}>+</button>
    </view>
  )
}

render(<App />)

p.s.

由于用户代码都在 worker 中运行,所以 document、window、cookie、fetch,localstorage 等都不能用

但是可以使用 xhr 和 indexDB,双线程的目的就在于此,不是不让用,而是真的没得用