@quenty/collectionserviceutils 3.1.1 → 3.2.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
+ # [3.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/collectionserviceutils@3.1.1...@quenty/collectionserviceutils@3.2.0) (2023-12-14)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add RxCollectionServiceUtils.observeTagged(tagName) ([1d611ce](https://github.com/Quenty/NevermoreEngine/commit/1d611ceaa94758872c1645249e17936348f5e016))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [3.1.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/collectionserviceutils@3.1.0...@quenty/collectionserviceutils@3.1.1) (2023-10-28)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/collectionserviceutils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/collectionserviceutils",
3
- "version": "3.1.1",
3
+ "version": "3.2.0",
4
4
  "description": "Utility functions for use with collection service tags",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -21,10 +21,10 @@
21
21
  "url": "https://www.patreon.com/quenty"
22
22
  },
23
23
  "dependencies": {
24
- "@quenty/brio": "^9.1.1",
25
- "@quenty/loader": "^7.0.0",
24
+ "@quenty/brio": "^9.2.0",
25
+ "@quenty/loader": "^7.1.0",
26
26
  "@quenty/maid": "^2.6.0",
27
- "@quenty/rx": "^8.1.1"
27
+ "@quenty/rx": "^8.2.0"
28
28
  },
29
29
  "license": "MIT",
30
30
  "contributors": [
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "440aca7ce2b50b74317ee05fdc0b8d1e58001af3"
36
+ "gitHead": "2c2dbbc0cb2fbb46b4f3270c559c63890fe18b26"
37
37
  }
@@ -43,4 +43,30 @@ function RxCollectionServiceUtils.observeTaggedBrio(tagName)
43
43
  end)
44
44
  end
45
45
 
46
+ --[=[
47
+ Observes tagged instances without a brio (so just when the item is added or on-init
48
+
49
+ @param tagName string
50
+ @return Observable<Instance>
51
+ ]=]
52
+ function RxCollectionServiceUtils.observeTagged(tagName)
53
+ assert(type(tagName) == "string", "Bad tagName")
54
+
55
+ return Observable.new(function(sub)
56
+ local maid = Maid.new()
57
+
58
+ local function handleItemAdded(inst)
59
+ sub:Fire(inst)
60
+ end
61
+
62
+ maid:GiveTask(CollectionService:GetInstanceAddedSignal(tagName):Connect(handleItemAdded))
63
+
64
+ for _, inst in pairs(CollectionService:GetTagged(tagName)) do
65
+ task.spawn(handleItemAdded, inst)
66
+ end
67
+
68
+ return maid
69
+ end)
70
+ end
71
+
46
72
  return RxCollectionServiceUtils