@bazir/utils 0.1.7 → 0.1.8

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.
Files changed (2) hide show
  1. package/out/Network.luau +5 -6
  2. package/package.json +4 -4
package/out/Network.luau CHANGED
@@ -6,7 +6,7 @@ local createError = _Error.createError
6
6
  local _Platform = TS.import(script, TS.getModule(script, "@bazir", "core").out.Platform)
7
7
  local getDebugInfo = _Platform.getDebugInfo
8
8
  local isRunningOnServer = _Platform.isRunningOnServer
9
- local connect = TS.import(script, TS.getModule(script, "@bazir", "core").out.Signal).connect
9
+ local subscribe = TS.import(script, TS.getModule(script, "@bazir", "state").out.State).subscribe
10
10
  local _State = TS.import(script, TS.getModule(script, "@bazir", "state").out.State)
11
11
  local createState = _State.createState
12
12
  local peek = _State.peek
@@ -244,10 +244,7 @@ do
244
244
  local _player = player
245
245
  activePlayers[_player] = nil
246
246
  end)
247
- local lastValue
248
- connect(state, function()
249
- local newValue = peek(state)
250
- lastValue = newValue
247
+ subscribe(state, function(newValue, lastValue)
251
248
  local patches = diff(lastValue, newValue)
252
249
  if patches == nil then
253
250
  return nil
@@ -255,7 +252,9 @@ do
255
252
  for player in activePlayers do
256
253
  fireClient(applyPatches, player, patches)
257
254
  end
258
- end)
255
+ end, {
256
+ immediate = true,
257
+ })
259
258
  onServer(connectPatches, function(player)
260
259
  local patches = diff(initialValue, peek(state))
261
260
  if patches ~= nil then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bazir/utils",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Utility functions for Bazir framework",
5
5
  "main": "out/init.lua",
6
6
  "types": "out/index.d.ts",
@@ -26,9 +26,9 @@
26
26
  "author": "",
27
27
  "license": "ISC",
28
28
  "dependencies": {
29
- "@bazir/core": "^0.1.6",
30
- "@bazir/state": "^0.1.7",
31
- "@bazir/ui": "^0.1.7",
29
+ "@bazir/core": "^0.1.9",
30
+ "@bazir/state": "^0.1.9",
31
+ "@bazir/ui": "^0.1.9",
32
32
  "@rbxts/services": "^1.5.5"
33
33
  },
34
34
  "devDependencies": {