Skip to content

Commit

Permalink
Revert "Patch: Update old samples and their sources."
Browse files Browse the repository at this point in the history
This reverts commit 2f9a8a2.

Revert "Enhancement: Update old samples and their sources."

This reverts commit d005379.
  • Loading branch information
robloxiandemo committed May 1, 2024
1 parent 8fa4f1f commit 481ae46
Show file tree
Hide file tree
Showing 84 changed files with 557 additions and 434 deletions.
109 changes: 0 additions & 109 deletions samples/Luau/EnumList.luau

This file was deleted.

213 changes: 0 additions & 213 deletions samples/Luau/Maid.luau

This file was deleted.

22 changes: 22 additions & 0 deletions samples/Luau/createProcessor.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--// Authored by @sinlerdev (https://github.com/sinlerdev)
--// Fetched from (https://github.com/vinum-team/Vinum/blob/b80a6c194e6901f9d400968293607218598e1386/src/Utils/createProcessor.luau)
--// Licensed under the MIT License (https://github.com/vinum-team/Vinum/blob/b80a6c194e6901f9d400968293607218598e1386/LICENSE)

--!strict
local function createProcessor(valueChecker: (a: any, b: any) -> boolean, cleaner: (taskItem: any) -> ())
return function<T>(old: T, new: T, isDestroying: boolean)
if isDestroying then
cleaner(old)
return false
end

if valueChecker(old, new) then
return false
end

cleaner(old)
return true
end
end

return createProcessor
37 changes: 37 additions & 0 deletions samples/Luau/createSignal.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
--// Authored by @AmaranthineCodices (https://github.com/AmaranthineCodices)
--// Fetched from (https://github.com/Floral-Abyss/recs/blob/be123afef8f1fddbd9464b7d34d5178393601ae3/recs/createSignal.luau)
--// Licensed under the MIT License (https://github.com/Floral-Abyss/recs/blob/master/LICENSE.md)

--!strict

local function createSignal()
local listeners = {}
local signal = {}

function signal:Connect(listener)
listeners[listener] = true

local connection = {
Connected = true,
}

function connection.Disconnect()
connection.Connected = false
listeners[listener] = nil
end
connection.disconnect = connection.Disconnect

return connection
end
signal.connect = signal.Connect

local function fire(...)
for listener, _ in pairs(listeners) do
spawn(listener, ...)
end
end

return signal, fire
end

return createSignal
Loading

0 comments on commit 481ae46

Please sign in to comment.