@quenty/statestack 14.12.1 → 14.13.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,17 @@
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.13.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@14.12.1...@quenty/statestack@14.13.0) (2024-11-06)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add StateStack:PushBrio ([afec365](https://github.com/Quenty/NevermoreEngine/commit/afec365f8437db31579088461d0026a788a8bf5f))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [14.12.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/statestack@14.12.0...@quenty/statestack@14.12.1) (2024-11-04)
7
18
 
8
19
  **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": "14.12.1",
3
+ "version": "14.13.0",
4
4
  "description": "Stack of values that allows multiple systems to enable or disable a state",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -26,14 +26,14 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@quenty/baseobject": "^10.7.1",
29
- "@quenty/brio": "^14.11.1",
29
+ "@quenty/brio": "^14.12.0",
30
30
  "@quenty/loader": "^10.7.1",
31
31
  "@quenty/maid": "^3.4.0",
32
- "@quenty/rx": "^13.11.1",
33
- "@quenty/valueobject": "^13.11.1"
32
+ "@quenty/rx": "^13.12.0",
33
+ "@quenty/valueobject": "^13.12.0"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "01c43a0ddd3c5e0cb2d9027313dbfa9852eedef1"
38
+ "gitHead": "00e6f71716216dd6ecbc8505ad898a1ab7f72756"
39
39
  }
@@ -103,6 +103,31 @@ function StateStack:PushState(state)
103
103
  end
104
104
  end
105
105
 
106
+ --[=[
107
+ Pushes the brio's content onto the stack for the lifetime of the brio
108
+
109
+ @param brio Brio
110
+ @return function -- Cleanup function
111
+ ]=]
112
+ function StateStack:PushBrio(brio)
113
+ if brio:IsDead() then
114
+ return
115
+ end
116
+
117
+ local maid, state = brio:ToMaidAndValue()
118
+ maid:GiveTask(self:PushState(state))
119
+
120
+ maid:GiveTask(function()
121
+ self._maid[maid] = nil
122
+ end)
123
+
124
+ self._maid[maid] = maid
125
+
126
+ return function()
127
+ self._maid[maid] = nil
128
+ end
129
+ end
130
+
106
131
  function StateStack:_popState(data)
107
132
  local index = table.find(self._stateStack, data)
108
133
  if index then