MarquezFabi / pika-webworker

简易封装的webworker插件

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

简单封装的webworker插件。

Features

  • 开箱即用,函数运行完后自动关闭webworker,减少内存占用。

Installation

With npm or yarn

yarn add pikaz-webworker

npm i -S pikaz-webworker

For Typical use

  import worker from 'pikaz-webworker'
  const arr = [
  { fuc: () => `函数一运行`, params: [] },
  { fuc: p => `函数${p}运行`, params: ['二'] },
]
worker.run(arr).then(res => {
  console.log(res)
})

About

简易封装的webworker插件


Languages

Language:JavaScript 100.0%