JSPM

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

Dead simple roblox-ts bindable event wrapper.

Package Exports

    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 directly or via an encapsulated connector, which is useful for replicating the behaviour of regular Roblox signals.

    Example

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

    class PingExample {
        // Both of these work!
        private ping = new Ping<(player: Player) => void>();
        private ping = new Ping<[player: Player]>();
    
        // Open up the API to connect to the ping externally
        public readonly onPing = this.ping.connector;
    
        private foo(player: Player) {
            // Alerts all connections
            this.ping.fire(player);
        }
    }
    
    const example = new PingExample();
    
    // To any external users, only .connect, .connectParallel and .wait are available.
    example.onPing.connect((player) => {
        print(player);
    });