@rbxts/replion 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  ## Install
4
4
  Install with [wally](https://wally.run/):\
5
- `Replion = "shouxtech/replion@1.0.13"`
5
+ `Replion = "shouxtech/replion@1.0.14"`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/replion",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "",
5
5
  "main": "src/init.lua",
6
6
  "scripts": {},
package/src/Server.lua CHANGED
@@ -116,7 +116,26 @@ function Server:observe(path: { string }?, callback: Observer)
116
116
  return self._signals[signalKey]:Connect(callback);
117
117
  end;
118
118
 
119
- function Server:set(path: { string }, value: any)
119
+ function Server:_recursiveSignalCheck(currentPath: { string }, updateTree: any)
120
+ for k, v in updateTree do
121
+ local nextPath = table.clone(currentPath);
122
+ table.insert(nextPath, k);
123
+
124
+ local signalKey = Shared.getSignalKey(nextPath);
125
+ local signal = self._signals[signalKey];
126
+
127
+ if signal then
128
+ local newValue = Shared.getNestedValue(self.data, nextPath);
129
+ signal:Fire(newValue, newValue); -- Warning: Sends improper 'old' argument due to shallow copy optimization.
130
+ end;
131
+
132
+ if typeof(v) == 'table' then
133
+ self:_recursiveSignalCheck(nextPath, v);
134
+ end;
135
+ end;
136
+ end;
137
+
138
+ function Server:set(path: {string}, value: any)
120
139
  if self._destroyed then return; end;
121
140
 
122
141
  local topKey = path[1];
@@ -144,6 +163,10 @@ function Server:set(path: { string }, value: any)
144
163
  pathSignal:Fire(newValue, oldValue)
145
164
  end;
146
165
  end;
166
+
167
+ if typeof(newValue) == 'table' then
168
+ self:_recursiveSignalCheck(path, newValue);
169
+ end;
147
170
 
148
171
  local thisUpdate = {};
149
172
  setNestedValue(thisUpdate, path, newValue);