Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions aftman.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file lists tools managed by Aftman, a cross-platform toolchain manager.
# For more information, see https://github.com/LPGhatguy/aftman

# To add a new tool, add an entry to this table.
[tools]
rojo = "rojo-rbx/rojo@7.4.1"
wally = "UpliftGames/wally@0.3.2"
selene = "Kampfkarren/selene@0.27.1"
18 changes: 1 addition & 17 deletions default.project.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
{
"name": "ReplicaService",
"servePlaceIds": null,
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"$className": "ReplicatedStorage",
"$ignoreUnknownInstances": true,
"$path": "src/ReplicatedStorage"
},
"ServerScriptService": {
"$className": "ServerScriptService",
"$ignoreUnknownInstances": true,
"$path": "src/ServerScriptService"
},
"ServerStorage": {
"$className": "ServerStorage",
"$ignoreUnknownInstances": true,
"$path": "src/ServerStorage"
}
"$path": "src"
}
}
1 change: 1 addition & 0 deletions selene.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
std = "roblox"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,21 @@ Replica = {}
Replica.__index = Replica

-- Listening:
function Replica:Observe(path, listener) --> [ScriptConnection] listener(new_value)
if type(listener) ~= "function" then
error("[ReplicaController]: Only a function can be set as listener in Replica:Observe()")
end

local path_array = (type(path) == "string") and StringPathToArray(path) or path
if #path_array < 1 then
error("[ReplicaController]: Passed empty path - a value key must be specified")
end

listener(self.Data[path])

return self:ListenToChange(path, listener)
end

function Replica:ListenToChange(path, listener) --> [ScriptConnection] listener(new_value)
if type(listener) ~= "function" then
error("[ReplicaController]: Only a function can be set as listener in Replica:ListenToChange()")
Expand Down Expand Up @@ -1086,4 +1101,4 @@ rev_ReplicaDestroy.OnClientEvent:Connect(function(replica_id) -- (replica_id)
DestroyReplicaAndDescendantsRecursive(replica)
end)

return ReplicaController
return ReplicaController
File renamed without changes.
Loading