@quenty/userserviceutils 9.2.0 → 9.2.1-canary.949c41d.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
+ ## [9.2.1-canary.949c41d.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/userserviceutils@9.2.0...@quenty/userserviceutils@9.2.1-canary.949c41d.0) (2024-05-03)
7
+
8
+
9
+ ### Features
10
+
11
+ * Centralize UserInfoService ([f6ae4fa](https://github.com/Quenty/NevermoreEngine/commit/f6ae4fae667165be7c25cecd8f3915353c8b22f6))
12
+
13
+
14
+
15
+
16
+
6
17
  # [9.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/userserviceutils@9.1.0...@quenty/userserviceutils@9.2.0) (2024-04-27)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/userserviceutils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/userserviceutils",
3
- "version": "9.2.0",
3
+ "version": "9.2.1-canary.949c41d.0",
4
4
  "description": "Utilities involving UserService in Roblox",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,16 +25,16 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/baseobject": "^10.2.0",
29
- "@quenty/loader": "^10.2.0",
30
- "@quenty/maid": "^3.1.0",
31
- "@quenty/math": "^2.6.0",
32
- "@quenty/promise": "^10.2.0",
33
- "@quenty/rx": "^13.2.0",
34
- "@quenty/servicebag": "^11.2.0"
28
+ "@quenty/baseobject": "10.2.0",
29
+ "@quenty/loader": "10.2.0",
30
+ "@quenty/maid": "3.1.0",
31
+ "@quenty/math": "2.6.0",
32
+ "@quenty/promise": "10.2.0",
33
+ "@quenty/rx": "13.2.0",
34
+ "@quenty/servicebag": "11.2.1-canary.949c41d.0"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "5c9eab1eac73f0d54953cca5017b7be968182f72"
39
+ "gitHead": "949c41de617e38c33da8d7d4351cc9fa34ae529d"
40
40
  }
@@ -17,8 +17,7 @@ function UserInfoService:Init(serviceBag)
17
17
  self._serviceBag = assert(serviceBag, "No serviceBag")
18
18
  self._maid = Maid.new()
19
19
 
20
- self._aggregator = UserInfoAggregator.new()
21
- self._maid:GiveTask(self._aggregator)
20
+ self._aggregator = self._maid:Add(UserInfoAggregator.new())
22
21
  end
23
22
 
24
23
  --[=[
@@ -1,77 +0,0 @@
1
- --[=[
2
- Centralized provider for user info so we can coordinate web requests.
3
-
4
- @class UserInfoServiceClient
5
- ]=]
6
-
7
- local require = require(script.Parent.loader).load(script)
8
-
9
- local UserInfoAggregator = require("UserInfoAggregator")
10
- local Maid = require("Maid")
11
-
12
- local UserInfoServiceClient = {}
13
- UserInfoServiceClient.ServiceName = "UserInfoServiceClient"
14
-
15
- function UserInfoServiceClient:Init(serviceBag)
16
- assert(not self._serviceBag, "Already initialized")
17
- self._serviceBag = assert(serviceBag, "No serviceBag")
18
- self._maid = Maid.new()
19
-
20
- self._aggregator = UserInfoAggregator.new()
21
- self._maid:GiveTask(self._aggregator)
22
- end
23
-
24
- --[=[
25
- Promises the user info for the given user, aggregating all requests to reduce
26
- calls into Roblox.
27
-
28
- @param userId number
29
- @return Promise<UserInfo>
30
- ]=]
31
- function UserInfoServiceClient:PromiseUserInfo(userId)
32
- assert(type(userId) == "number", "Bad userId")
33
-
34
- return self._aggregator:PromiseUserInfo(userId)
35
- end
36
-
37
- --[=[
38
- Promises the user display name for the userId
39
-
40
- @param userId number
41
- @return Promise<string>
42
- ]=]
43
- function UserInfoServiceClient:PromiseDisplayName(userId)
44
- assert(type(userId) == "number", "Bad userId")
45
-
46
- return self._aggregator:PromiseDisplayName(userId)
47
- end
48
-
49
- --[=[
50
- Observes the user info for the user
51
-
52
- @param userId number
53
- @return Observable<UserInfo>
54
- ]=]
55
- function UserInfoServiceClient:ObserveUserInfo(userId)
56
- assert(type(userId) == "number", "Bad userId")
57
-
58
- return self._aggregator:ObserveDisplayName(userId)
59
- end
60
-
61
- --[=[
62
- Observes the user display name for the userId
63
-
64
- @param userId number
65
- @return Observable<string>
66
- ]=]
67
- function UserInfoServiceClient:ObserveDisplayName(userId)
68
- assert(type(userId) == "number", "Bad userId")
69
-
70
- return self._aggregator:ObserveDisplayName(userId)
71
- end
72
-
73
- function UserInfoServiceClient:Destroy()
74
- self._maid:DoCleaning()
75
- end
76
-
77
- return UserInfoServiceClient