ShadowTable - OOP table with .Changed event

About

I made this module for my project, It’s just basically an OOP table wrapper with a .Changed event using FastSignal. It’s pretty optimized for large-scale projects.

Where can i get it?

You can get it from Github here or from marketplace here.

API

ShadowTable.New(Data : {any})

Creates new ShadowTable class.

ShadowTable:SetProperty(PropertyName : string, NewValue : any)

Sets property(key) in ShadowTable class’s data.

ShadowTable:GetProperty(PropertyName : string) : any

Receives property(key) in ShadowTable class’s data.

ShadowTable:OnChangedProperty(PropertyName : any, Callback : (NewValue : any) -> ())

Fires when there is a change in certain property of ShadowTable class’s data.

ShadowTable:OnAnyChangedProperty(Callback : () -> ())

Fires when there is a change in ANY property of ShadowTable class’s data.

ShadowTable:Remove()

Removes ShadowTable class and disconnects all .Changed signals.

4 Likes

I don’t understand why people post releases to GitHub but not post the source code…

1 Like

Sorry this is my first resource

Posted the source code on github page.

Wouldn’t this increase the memory usage exponentially?
Can you list use cases that would make the positive outweigh the negative?

and I still can’t see the source code on github without downloading it ( the scripts should show here )

It should be in the repository, not on the release, else it is still quite problematic

For this, quite honestly, I’d have used custom __index and __newindex functions, potentially. It would probably remove the ugly GetProperty and SetProperty methods.

It also goes that the state isn’t self contained, with that table object itself being basically converted into a glorified table key, I’d say this could be optimized without major issues, in my opinion.

V1.1:

  • FIxed all issues with Github(Finally!)
  • Cleaned up code
  • Now module only using 1 signal instead of signal on every property
  • Optimized cpu usage
  • Updated API
2 Likes

V1.1.1:

  • Removed Settings
  • Now module uses --!strict
  • Changed API
1 Like