BindableService - Convenient replacement of BindableEvents/Functions

Introducing BindableService!

BindableService is a convenient replacement of BindableEvents/Functions, as you won’t need to be referencing your Bindables which might be in anywhere across many scripts.

And beside that, it provides nothing additional. :skull:

Features

  • Convinient and Organized, that’s why I made this resource. :convenience_store:
  • Safe to interact from multiple scripts. :white_check_mark:

Documentation

BindableService

.Event(id: string): Event
--// Returns a existing Event else a new one with the identifier.
.Function(id: string): Func
--// Returns a existing Func else a new one with the identifier.

Event

:Fire(...: any) void
--// Fires the Event along with delivering given data.
:OnEvent(callback: (any) -> ()) void
--// Binds a callback to the Event. Removes the callback if nil is given.
:Destroy() void
--// Purges all data within the Event and making it unusable afterwards.

Func

:Invoke(...: any): any
--// Fires the Event along with delivering given data.
:OnInvoke(callback: (any) -> ()) void
--// Binds a callback to the Func. Removes the callback if nil is given. The value returned by the callback is returned to :Invoke().
:Destroy() void
--// Purges all data within the Func and making it unusable afterwards.

Download it here:

BindableService.rbxm (File) (1.4 KB)

That’s all!

Will you use BindableService?
  • Yes, this seems useful!
  • Looks good, might use it in the future.
  • I don’t think I’ll be using this.
0 voters
1 Like

Very nice, I made my own module for this a while ago, just uploaded it to my github a couple days ago. My event has some extra added functionalities to it

1 Like

It’s a good resource and I think you should be posting it on devforum too