UNPKG

kitten-cloud-function

Version:

用于编程猫源码云功能(云变量、云列表等)的客户端工具

24 lines (23 loc) 512 B
import { Signal } from "../utils/signal"; /** * 提供在线用户数相关功能。 */ export class KittenCloudOnlineUserNumber { constructor( /** * 当前在线用户数。 */ value) { this.value = value; this.changed = new Signal(); } update({ total }) { const originalNumber = this.value; const newNumber = total; this.value = newNumber; this.changed.emit({ originalNumber, newNumber }); } }