Package Exports
- @rbxts/ping
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 encapsulateed 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}.`);
});