1.0.0 • Published 5 years ago
@rbxts/tacheometrystestrepo v1.0.0
SimpleSignals
A Roblox-TS RemoteEvent/RemoteFunction/BindableEvent wrapper which puts and end to the hassle of managing events. You can get straight to connecting and firing without any WaitForChild/Instance.new boilerplate, while your event instances get created automatically in the background.
Usage
You can import the module this way on the server:
import { Server as SimpleSignals } from "shared/SimpleSignals";
and on the client:
import { Client as SimpleSignals } from "shared/SimpleSignals";
Where client/SimpleSignals
is:
import { Client } from "shared/SimpleSignals";
export = Client;
and the same for server/SimpleSignals
:
import { Server } from "shared/SimpleSignals";
export = Server;
Of course, you can rename the files so they're shorter. I wrote it like this for the sake of being explicit.
You can then import it from the client/server in this way:
import Simple from "server/SimpleSignals";
import Simple from "client/SimpleSignals";
(or something other than Simple
)
API
- Simple:onBindable(
name
: string,callback
: Function) →RBXScriptConnection
- Simple:onceBindable(
name
: string,callback
: Function) →void
- Simple:fireBindable(
name
: string,...args
) →void
- Simple:setCallback(
name
: string,callback
: Function) →void
- Simple:invoke(
name
: string,...args
) →unknown
(return value of the callback)
The library also has JSDoc comments provided inside the code.
1.0.0
5 years ago