@quenty/statestack 14.18.2 → 14.18.3
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 +8 -0
- package/package.json +8 -8
- package/src/Shared/StateStack.lua +12 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [14.18.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@14.18.2...@quenty/statestack@14.18.3) (2025-04-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/statestack
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [14.18.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@14.18.0...@quenty/statestack@14.18.2) (2025-04-07)
|
|
7
15
|
|
|
8
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/statestack",
|
|
3
|
-
"version": "14.18.
|
|
3
|
+
"version": "14.18.3",
|
|
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": "^10.8.
|
|
29
|
-
"@quenty/brio": "^14.17.
|
|
30
|
-
"@quenty/loader": "^10.8.
|
|
31
|
-
"@quenty/maid": "^3.4.
|
|
32
|
-
"@quenty/rx": "^13.17.
|
|
33
|
-
"@quenty/valueobject": "^13.17.
|
|
28
|
+
"@quenty/baseobject": "^10.8.3",
|
|
29
|
+
"@quenty/brio": "^14.17.3",
|
|
30
|
+
"@quenty/loader": "^10.8.3",
|
|
31
|
+
"@quenty/maid": "^3.4.3",
|
|
32
|
+
"@quenty/rx": "^13.17.3",
|
|
33
|
+
"@quenty/valueobject": "^13.17.3"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "b06c070ae91d5dab7bd8de6e290ad2caabb15d8f"
|
|
39
39
|
}
|
|
@@ -30,6 +30,7 @@ local _Brio = require("Brio")
|
|
|
30
30
|
local _Signal = require("Signal")
|
|
31
31
|
local _Observable = require("Observable")
|
|
32
32
|
local _Maid = require("Maid")
|
|
33
|
+
local _Rx = require("Rx")
|
|
33
34
|
|
|
34
35
|
local StateStack = setmetatable({}, BaseObject)
|
|
35
36
|
StateStack.ClassName = "StateStack"
|
|
@@ -37,14 +38,14 @@ StateStack.__index = StateStack
|
|
|
37
38
|
|
|
38
39
|
export type StateStack<T> = typeof(setmetatable(
|
|
39
40
|
{} :: {
|
|
40
|
-
|
|
41
|
+
Changed: _Signal.Signal<T>,
|
|
42
|
+
|
|
41
43
|
_state: ValueObject.ValueObject<T>,
|
|
42
44
|
_defaultValue: T,
|
|
43
45
|
_stateStack: { { T } },
|
|
44
|
-
Changed: _Signal.Signal<T>,
|
|
45
46
|
},
|
|
46
|
-
{ __index = StateStack }
|
|
47
|
-
))
|
|
47
|
+
{} :: typeof({ __index = StateStack })
|
|
48
|
+
)) & BaseObject.BaseObject
|
|
48
49
|
|
|
49
50
|
--[=[
|
|
50
51
|
Constructs a new StateStack.
|
|
@@ -52,7 +53,7 @@ export type StateStack<T> = typeof(setmetatable(
|
|
|
52
53
|
@param checkType string?
|
|
53
54
|
@return StateStack
|
|
54
55
|
]=]
|
|
55
|
-
function StateStack.new<T>(defaultValue: T, checkType): StateStack<T>
|
|
56
|
+
function StateStack.new<T>(defaultValue: T, checkType: ValueObject.ValueObjectTypeArg?): StateStack<T>
|
|
56
57
|
local self = setmetatable(BaseObject.new() :: any, StateStack)
|
|
57
58
|
|
|
58
59
|
self._state = self._maid:Add(ValueObject.new(defaultValue, checkType))
|
|
@@ -98,8 +99,11 @@ end
|
|
|
98
99
|
@param predicate function
|
|
99
100
|
@return Observable<T>
|
|
100
101
|
]=]
|
|
101
|
-
function StateStack.ObserveBrio<T>(
|
|
102
|
-
|
|
102
|
+
function StateStack.ObserveBrio<T>(
|
|
103
|
+
self: StateStack<T>,
|
|
104
|
+
predicate: _Rx.Predicate<T>?
|
|
105
|
+
): _Observable.Observable<_Brio.Brio<T>>
|
|
106
|
+
return self._state:ObserveBrio(predicate) :: any
|
|
103
107
|
end
|
|
104
108
|
|
|
105
109
|
--[=[
|
|
@@ -107,7 +111,7 @@ end
|
|
|
107
111
|
@param state T
|
|
108
112
|
@return function -- Cleanup function to invoke
|
|
109
113
|
]=]
|
|
110
|
-
function StateStack.PushState<T>(self: StateStack<T>, state: T): (
|
|
114
|
+
function StateStack.PushState<T>(self: StateStack<T>, state: T): () -> ()
|
|
111
115
|
local data: { T } = { state }
|
|
112
116
|
table.insert(self._stateStack, data)
|
|
113
117
|
self:_updateState()
|