@quenty/statestack 9.0.0-canary.367.e9fdcbc.0 → 9.0.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 +84 -1
- package/package.json +8 -8
- package/src/Shared/StateStack.lua +13 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,90 @@
|
|
|
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
|
-
# [9.0.0
|
|
6
|
+
# [9.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@8.24.0...@quenty/statestack@9.0.0) (2023-10-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/statestack
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [8.24.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@8.23.0...@quenty/statestack@8.24.0) (2023-09-21)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @quenty/statestack
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [8.23.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@8.22.0...@quenty/statestack@8.23.0) (2023-09-04)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @quenty/statestack
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# [8.22.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@8.21.0...@quenty/statestack@8.22.0) (2023-08-23)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @quenty/statestack
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# [8.21.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@8.20.0...@quenty/statestack@8.21.0) (2023-08-01)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* Add ObserveBrio() API call to StateStack ([048b333](https://github.com/Quenty/NevermoreEngine/commit/048b33336f4030fb9125afdd473270518bc62b09))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# [8.20.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@8.19.0...@quenty/statestack@8.20.0) (2023-07-28)
|
|
50
|
+
|
|
51
|
+
**Note:** Version bump only for package @quenty/statestack
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# [8.19.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@8.18.0...@quenty/statestack@8.19.0) (2023-07-23)
|
|
58
|
+
|
|
59
|
+
**Note:** Version bump only for package @quenty/statestack
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
# [8.18.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@8.17.0...@quenty/statestack@8.18.0) (2023-07-15)
|
|
66
|
+
|
|
67
|
+
**Note:** Version bump only for package @quenty/statestack
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# [8.17.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@8.16.0...@quenty/statestack@8.17.0) (2023-07-10)
|
|
74
|
+
|
|
75
|
+
**Note:** Version bump only for package @quenty/statestack
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# [8.16.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@8.15.0...@quenty/statestack@8.16.0) (2023-06-17)
|
|
82
|
+
|
|
83
|
+
**Note:** Version bump only for package @quenty/statestack
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
# [8.15.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@8.14.0...@quenty/statestack@8.15.0) (2023-06-05)
|
|
7
90
|
|
|
8
91
|
**Note:** Version bump only for package @quenty/statestack
|
|
9
92
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/statestack",
|
|
3
|
-
"version": "9.0.0
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Stack of values that allows multiple systems to enable or disable a state",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/baseobject": "
|
|
29
|
-
"@quenty/brio": "
|
|
30
|
-
"@quenty/loader": "
|
|
31
|
-
"@quenty/maid": "2.
|
|
32
|
-
"@quenty/rx": "
|
|
33
|
-
"@quenty/valueobject": "8.0.0
|
|
28
|
+
"@quenty/baseobject": "^7.0.0",
|
|
29
|
+
"@quenty/brio": "^9.0.0",
|
|
30
|
+
"@quenty/loader": "^7.0.0",
|
|
31
|
+
"@quenty/maid": "^2.6.0",
|
|
32
|
+
"@quenty/rx": "^8.0.0",
|
|
33
|
+
"@quenty/valueobject": "^8.0.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "fdeae46099587019ec5fc15317dc673aed379400"
|
|
39
39
|
}
|
|
@@ -33,13 +33,15 @@ StateStack.__index = StateStack
|
|
|
33
33
|
--[=[
|
|
34
34
|
Constructs a new StateStack.
|
|
35
35
|
@param defaultValue any -- The default value to use for the statestack.
|
|
36
|
+
@param checkType string | nil
|
|
36
37
|
@return StateStack
|
|
37
38
|
]=]
|
|
38
|
-
function StateStack.new(defaultValue)
|
|
39
|
+
function StateStack.new(defaultValue, checkType)
|
|
39
40
|
local self = setmetatable(BaseObject.new(), StateStack)
|
|
40
41
|
|
|
41
42
|
self._defaultValue = defaultValue
|
|
42
|
-
|
|
43
|
+
|
|
44
|
+
self._state = ValueObject.new(defaultValue, checkType)
|
|
43
45
|
self._maid:GiveTask(self._state)
|
|
44
46
|
|
|
45
47
|
self._stateStack = {}
|
|
@@ -78,6 +80,15 @@ function StateStack:Observe()
|
|
|
78
80
|
return self._state:Observe()
|
|
79
81
|
end
|
|
80
82
|
|
|
83
|
+
--[=[
|
|
84
|
+
Observes the current value of stack
|
|
85
|
+
@param predicate function
|
|
86
|
+
@return Observable<T?>
|
|
87
|
+
]=]
|
|
88
|
+
function StateStack:ObserveBrio(predicate)
|
|
89
|
+
return self._state:ObserveBrio(predicate)
|
|
90
|
+
end
|
|
91
|
+
|
|
81
92
|
--[=[
|
|
82
93
|
Pushes the current state onto the stack
|
|
83
94
|
@param state T?
|