sync-util
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

sync-util

定时将数据同步到数据库。开发时享受代码提示。

Installation

npm i sync-util

Usage

import { SyncUtil } from "sync-util";

class PlayerSync {
    async updateCard(userId: number, cardInfo: any) {
        console.log("---updateCard--", userId, cardInfo)
    }
}

let syncUtil = new SyncUtil({
    "handler": {
        "PlayerSync": new PlayerSync()
    },
    "syncInterval": 3 * 1000
});

syncUtil.sync.PlayerSync.updateCard(1, { "cardId": 3 });
syncUtil.saveAll();

Readme

Keywords

Package Sidebar

Install

npm i sync-util

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

23.1 kB

Total Files

5

Last publish

Collaborators

  • ahuang