Skip to content

Commit 481ae46

Browse files
committed
Revert "Patch: Update old samples and their sources."
This reverts commit 2f9a8a2. Revert "Enhancement: Update old samples and their sources." This reverts commit d005379.
1 parent 8fa4f1f commit 481ae46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+557
-434
lines changed

samples/Luau/EnumList.luau

Lines changed: 0 additions & 109 deletions
This file was deleted.

samples/Luau/Maid.luau

Lines changed: 0 additions & 213 deletions
This file was deleted.

samples/Luau/createProcessor.luau

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--// Authored by @sinlerdev (https://github.com/sinlerdev)
2+
--// Fetched from (https://github.com/vinum-team/Vinum/blob/b80a6c194e6901f9d400968293607218598e1386/src/Utils/createProcessor.luau)
3+
--// Licensed under the MIT License (https://github.com/vinum-team/Vinum/blob/b80a6c194e6901f9d400968293607218598e1386/LICENSE)
4+
5+
--!strict
6+
local function createProcessor(valueChecker: (a: any, b: any) -> boolean, cleaner: (taskItem: any) -> ())
7+
return function<T>(old: T, new: T, isDestroying: boolean)
8+
if isDestroying then
9+
cleaner(old)
10+
return false
11+
end
12+
13+
if valueChecker(old, new) then
14+
return false
15+
end
16+
17+
cleaner(old)
18+
return true
19+
end
20+
end
21+
22+
return createProcessor

samples/Luau/createSignal.luau

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--// Authored by @AmaranthineCodices (https://github.com/AmaranthineCodices)
2+
--// Fetched from (https://github.com/Floral-Abyss/recs/blob/be123afef8f1fddbd9464b7d34d5178393601ae3/recs/createSignal.luau)
3+
--// Licensed under the MIT License (https://github.com/Floral-Abyss/recs/blob/master/LICENSE.md)
4+
5+
--!strict
6+
7+
local function createSignal()
8+
local listeners = {}
9+
local signal = {}
10+
11+
function signal:Connect(listener)
12+
listeners[listener] = true
13+
14+
local connection = {
15+
Connected = true,
16+
}
17+
18+
function connection.Disconnect()
19+
connection.Connected = false
20+
listeners[listener] = nil
21+
end
22+
connection.disconnect = connection.Disconnect
23+
24+
return connection
25+
end
26+
signal.connect = signal.Connect
27+
28+
local function fire(...)
29+
for listener, _ in pairs(listeners) do
30+
spawn(listener, ...)
31+
end
32+
end
33+
34+
return signal, fire
35+
end
36+
37+
return createSignal

0 commit comments

Comments
 (0)