@quenty/statestack 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 +19 -0
- package/package.json +7 -6
- package/src/Shared/RxStateStackUtils.lua +24 -0
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/statestack@5.0.0...@quenty/statestack@5.1.0-canary.252.9753dcc.0) (2022-03-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/statestack
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [5.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@4.0.0...@quenty/statestack@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/statestack@3.5.0...@quenty/statestack@4.0.0) (2022-01-17)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @quenty/statestack
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/statestack",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.1.0-canary.252.9753dcc.0",
|
|
4
4
|
"description": "Stack of values that allows multiple systems to enable or disable a state",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,13 +25,14 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/baseobject": "
|
|
29
|
-
"@quenty/brio": "
|
|
30
|
-
"@quenty/loader": "
|
|
31
|
-
"@quenty/
|
|
28
|
+
"@quenty/baseobject": "4.1.0-canary.252.9753dcc.0",
|
|
29
|
+
"@quenty/brio": "5.1.0-canary.252.9753dcc.0",
|
|
30
|
+
"@quenty/loader": "4.0.0",
|
|
31
|
+
"@quenty/rx": "4.1.0-canary.252.9753dcc.0",
|
|
32
|
+
"@quenty/valueobject": "4.1.0-canary.252.9753dcc.0"
|
|
32
33
|
},
|
|
33
34
|
"publishConfig": {
|
|
34
35
|
"access": "public"
|
|
35
36
|
},
|
|
36
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "9753dcc02d4600d2706d8003cebb325ccfcde523"
|
|
37
38
|
}
|
|
@@ -47,4 +47,28 @@ function RxStateStackUtils.topOfStack()
|
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
+
--[=[
|
|
51
|
+
Creates a state stack from the brio's value. The state stack holds the last
|
|
52
|
+
value seen that is valid.
|
|
53
|
+
|
|
54
|
+
@param observable Observable<Brio<T>>
|
|
55
|
+
@return StateStack<T>
|
|
56
|
+
]=]
|
|
57
|
+
function RxStateStackUtils.createStateStack(observable)
|
|
58
|
+
local stateStack = StateStack.new(nil)
|
|
59
|
+
|
|
60
|
+
stateStack._maid:GiveTask(observable:Subscribe(function(value)
|
|
61
|
+
assert(Brio.isBrio(value), "Observable must emit brio")
|
|
62
|
+
|
|
63
|
+
if value:IsDead() then
|
|
64
|
+
return
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
local maid = value:ToMaid()
|
|
68
|
+
maid:GiveTask(stateStack:PushState(value:GetValue()))
|
|
69
|
+
end))
|
|
70
|
+
|
|
71
|
+
return stateStack
|
|
72
|
+
end
|
|
73
|
+
|
|
50
74
|
return RxStateStackUtils
|