@quenty/brio 4.0.0 → 5.1.0-canary.252.9753dcc.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.1.0-canary.252.9753dcc.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/brio@5.0.0...@quenty/brio@5.1.0-canary.252.9753dcc.0) (2022-03-10)
7
+
8
+ **Note:** Version bump only for package @quenty/brio
9
+
10
+
11
+
12
+
13
+
14
+ # [5.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/brio@4.0.0...@quenty/brio@5.0.0) (2022-03-06)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * Fix circular dependency, move createStateStack from Brio ([9568dd7](https://github.com/Quenty/NevermoreEngine/commit/9568dd78272e487e17e9fb08034a58275838add9))
20
+
21
+
22
+
23
+
24
+
6
25
  # [4.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/brio@3.8.0...@quenty/brio@4.0.0) (2022-01-17)
7
26
 
8
27
  **Note:** Version bump only for package @quenty/brio
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/brio",
3
- "version": "4.0.0",
3
+ "version": "5.1.0-canary.252.9753dcc.0",
4
4
  "description": "Brios wrap an object and either are alive or dead",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -26,13 +26,12 @@
26
26
  "Quenty"
27
27
  ],
28
28
  "dependencies": {
29
- "@quenty/loader": "^3.4.0",
30
- "@quenty/maid": "^2.1.0",
31
- "@quenty/rx": "^3.8.0",
32
- "@quenty/statestack": "^4.0.0"
29
+ "@quenty/loader": "4.0.0",
30
+ "@quenty/maid": "2.2.0-canary.252.9753dcc.0",
31
+ "@quenty/rx": "4.1.0-canary.252.9753dcc.0"
33
32
  },
34
33
  "publishConfig": {
35
34
  "access": "public"
36
35
  },
37
- "gitHead": "cbd40cfd2fd23c14978a3154cad9d1e3d1c78edf"
36
+ "gitHead": "9753dcc02d4600d2706d8003cebb325ccfcde523"
38
37
  }
@@ -13,7 +13,6 @@ local BrioUtils = require("BrioUtils")
13
13
  local Maid = require("Maid")
14
14
  local Observable = require("Observable")
15
15
  local Rx = require("Rx")
16
- local StateStack= require("StateStack")
17
16
 
18
17
  local RxBrioUtils = {}
19
18
 
@@ -32,30 +31,6 @@ function RxBrioUtils.toBrio()
32
31
  end)
33
32
  end
34
33
 
35
- --[=[
36
- Creates a state stack from the brio's value. The state stack holds the last
37
- value seen that is valid.
38
-
39
- @param observable Observable<Brio<T>>
40
- @return StateStack<T>
41
- ]=]
42
- function RxBrioUtils.createStateStack(observable)
43
- local stateStack = StateStack.new(nil)
44
-
45
- stateStack._maid:GiveTask(observable:Subscribe(function(value)
46
- assert(Brio.isBrio(value), "Observable must emit brio")
47
-
48
- if value:IsDead() then
49
- return
50
- end
51
-
52
- local maid = value:ToMaid()
53
- maid:GiveTask(stateStack:PushState(value:GetValue()))
54
- end))
55
-
56
- return stateStack
57
- end
58
-
59
34
  --[=[
60
35
  Completes the observable on death
61
36
 
@@ -141,21 +116,23 @@ function RxBrioUtils.emitWhileAllDead(valueToEmitWhileAllDead)
141
116
  updateBrios()
142
117
  end
143
118
 
144
- topMaid:GiveTask(source:Subscribe(function(brio)
145
- if not Brio.isBrio(brio) then
146
- warn(("[RxBrioUtils.emitWhileAllDead] - Not a brio, %q"):format(tostring(brio)))
147
- topMaid._lastBrio = nil
148
- sub:Fail("Not a brio")
149
- return
150
- end
119
+ topMaid:GiveTask(source:Subscribe(
120
+ function(brio)
121
+ if not Brio.isBrio(brio) then
122
+ warn(("[RxBrioUtils.emitWhileAllDead] - Not a brio, %q"):format(tostring(brio)))
123
+ topMaid._lastBrio = nil
124
+ sub:Fail("Not a brio")
125
+ return
126
+ end
151
127
 
152
- handleNewBrio(brio)
153
- end, function(...)
154
- sub:Fail(...)
155
- end,
156
- function(...)
157
- sub:Complete(...)
158
- end))
128
+ handleNewBrio(brio)
129
+ end,
130
+ function(...)
131
+ sub:Fail(...)
132
+ end,
133
+ function(...)
134
+ sub:Complete(...)
135
+ end))
159
136
 
160
137
  -- Make sure we emit an empty list if we discover nothing
161
138
  if not fired then
@@ -235,22 +212,23 @@ function RxBrioUtils.reduceToAliveList(selectFromBrio)
235
212
  updateBrios()
236
213
  end
237
214
 
238
- topMaid:GiveTask(source:Subscribe(function(brio)
239
- if not Brio.isBrio(brio) then
240
- warn(("[RxBrioUtils.mergeToAliveList] - Not a brio, %q"):format(tostring(brio)))
241
- topMaid._lastBrio = nil
242
- sub:Fail("Not a brio")
243
- return
244
- end
215
+ topMaid:GiveTask(source:Subscribe(
216
+ function(brio)
217
+ if not Brio.isBrio(brio) then
218
+ warn(("[RxBrioUtils.mergeToAliveList] - Not a brio, %q"):format(tostring(brio)))
219
+ topMaid._lastBrio = nil
220
+ sub:Fail("Not a brio")
221
+ return
222
+ end
245
223
 
246
- handleNewBrio(brio)
247
- end,
248
- function(...)
249
- sub:Fail(...)
250
- end,
251
- function(...)
252
- sub:Complete(...)
253
- end))
224
+ handleNewBrio(brio)
225
+ end,
226
+ function(...)
227
+ sub:Fail(...)
228
+ end,
229
+ function(...)
230
+ sub:Complete(...)
231
+ end))
254
232
 
255
233
  -- Make sure we emit an empty list if we discover nothing
256
234
  if not fired then
@@ -272,33 +250,34 @@ function RxBrioUtils.reemitLastBrioOnDeath()
272
250
  return Observable.new(function(sub)
273
251
  local maid = Maid.new()
274
252
 
275
- maid:GiveTask(source:Subscribe(function(brio)
276
- maid._conn = nil
253
+ maid:GiveTask(source:Subscribe(
254
+ function(brio)
255
+ maid._conn = nil
277
256
 
278
- if not Brio.isBrio(brio) then
279
- warn(("[RxBrioUtils.reemitLastBrioOnDeath] - Not a brio, %q"):format(tostring(brio)))
280
- sub:Fail("Not a brio")
281
- return
282
- end
257
+ if not Brio.isBrio(brio) then
258
+ warn(("[RxBrioUtils.reemitLastBrioOnDeath] - Not a brio, %q"):format(tostring(brio)))
259
+ sub:Fail("Not a brio")
260
+ return
261
+ end
283
262
 
284
- if brio:IsDead() then
285
- sub:Fire(brio)
286
- return
287
- end
263
+ if brio:IsDead() then
264
+ sub:Fire(brio)
265
+ return
266
+ end
288
267
 
289
- -- Setup conn!
290
- maid._conn = brio:GetDiedSignal():Connect(function()
291
- sub:Fire(brio)
292
- end)
268
+ -- Setup conn!
269
+ maid._conn = brio:GetDiedSignal():Connect(function()
270
+ sub:Fire(brio)
271
+ end)
293
272
 
294
- sub:Fire(brio)
295
- end,
296
- function(...)
297
- sub:Fail(...)
298
- end,
299
- function(...)
300
- sub:Complete(...)
301
- end))
273
+ sub:Fire(brio)
274
+ end,
275
+ function(...)
276
+ sub:Fail(...)
277
+ end,
278
+ function(...)
279
+ sub:Complete(...)
280
+ end))
302
281
 
303
282
  return maid
304
283
  end)