@x_m/prize-wheel-helper
TypeScript icon, indicating that this package has built-in type declarations

0.1.9 • Public • Published

@x_m/prize-wheel-helper

@x_m/prize-wheel的 react 辅助函数

install

yarn add  @x_m/prize-wheel-helper @x_m/prize-wheel

examples

import { PrizeWheel } from '@x_m/prize-wheel'
import { usePrizeWheelState } from '@x_m/prize-wheel-helper'

/**
 * PrizeWheel 只负责逻辑部分,
 * 渲染转盘由使用者自己负责,
 * 因此可用于 react / vue / vanilla / node...
 */
const wheel = new PrizeWheel()

// in react
const { deg, running } = usePrizeWheelState(wheel)
// render your prize wheel with deg
CustomPrizeWheelRenderer(deg)

wheel.run()

wheel.shouldStopAtDeg(any degree)

Readme

Keywords

none

Package Sidebar

Install

npm i @x_m/prize-wheel-helper

Weekly Downloads

0

Version

0.1.9

License

MIT

Unpacked Size

5.33 kB

Total Files

8

Last publish

Collaborators

  • xiaomingtang