Welcome to my very first Open-Source Module! TableEvents v1
How To Use
local TableEvents = require(game.ReplicatedStorage.TableEvents) or require(6300553152)() -- Parents to ReplicatedStorage by default.
local ourTable = TableEvents.new(<table> table) -- The table argument is not required only necessary if you want to set table values ahead of time.
Functions
> table:GetEvents() -- Returns Table Of Events (BindableEvent.Event) <table>
> -
> Added <event> Args(index <variant>, newValue <variant>) -- Fires When A Value Is Added
> Changed <event> Args(index <variant>, oldValue <variant>, newValue <variant>) -- Fires When A Value Is Changed
> Removed <event> Args(index <variant>, oldValue <variant>) -- Fires When A Value Is Removed From The Table (nil)
> Retrieved <event> Args(index <variant>, currentValue <variant>) -- Fires When A Value Is Retrieved From The Table
> table:GetRawTable() -- Returns A Copy Of The Original Table (Used For Iteration) <table>
> -
> for i,v in pairs(table:GetRawTable()) do
> print(i,v)
> end
> table:Rawset(index <variant>, newValue <variant>) -- Sets A Table's Value Without Firing Any Events & Ignores ReadOnly
> -
> table:Rawset(1,true)
> table:Rawget(index <variant>) -- Gets A Table's Value Without Firing Any Events <variant>
> -
> print(table:Rawget(1))
> table:SetReadOnly(boolean <boolean>) -- Sets Whether The Table Is Editable
> -
> table:SetReadOnly(true)
> table:GetReadOnly() -- Gets Whether The Table Is Editable <boolean>
> -
> print(table:GetReadOnly()) -- true or false
Enjoy! Contact me at:
π°π©π’π’ππ π¬π‘π’π°#0001