JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18
  • Score
    100M100P100Q47782F
  • License MIT

Dead simple roblox-ts bindable event wrapper.

Package Exports

  • @rbxts/ping
  • @rbxts/ping/out/init.lua

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rbxts/ping) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Ping

Yet another super simple bindable event wrapper which uses ✨camelCase✨ and allows connection via a encapsulated connector or with the connect function.

Example

A simple example, there isn't much to this library.

interface PlayerData {
    level: number;
}

class PlayerDataService {
    private ping = new Ping<(player: Player, data: PlayerData) => void>();
    public readonly onDataUpdated = this.ping.connector;

    public update(player: Player, data: PlayerData) {
        this.ping.fire(player, data);
    }
}

new PlayerDataService().onDataUpdated.connect((player, data) => {
    print(`Player data updated for ${player.Name}, new data: ${data}.`);
});