@quenty/marketplaceutils 11.3.0 → 11.4.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
+ # [11.4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/marketplaceutils@11.3.0...@quenty/marketplaceutils@11.4.0) (2024-05-18)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add MarketplaceServiceCache ([fafe9b4](https://github.com/Quenty/NevermoreEngine/commit/fafe9b4ceb5148b46d046e8fef333eb3e1f8433f))
12
+
13
+
14
+
15
+
16
+
6
17
  # [11.3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/marketplaceutils@11.2.0...@quenty/marketplaceutils@11.3.0) (2024-05-09)
7
18
 
8
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/marketplaceutils",
3
- "version": "11.3.0",
3
+ "version": "11.4.0",
4
4
  "description": "Provides utility methods for MarketplaceService",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -27,10 +27,11 @@
27
27
  ],
28
28
  "dependencies": {
29
29
  "@quenty/loader": "^10.3.0",
30
+ "@quenty/memoize": "^1.1.0",
30
31
  "@quenty/promise": "^10.3.0"
31
32
  },
32
33
  "publishConfig": {
33
34
  "access": "public"
34
35
  },
35
- "gitHead": "3fd5cdca3128bf34c8d9dfae1e92d62533b6e6f5"
36
+ "gitHead": "a9256cab3584bea4bd32c327d00b9a52f2a3ec95"
36
37
  }
@@ -0,0 +1,36 @@
1
+ --[=[
2
+ @class MarketplaceServiceCache
3
+ ]=]
4
+
5
+ local require = require(script.Parent.loader).load(script)
6
+
7
+ local MemorizeUtils = require("MemorizeUtils")
8
+ local MarketplaceUtils = require("MarketplaceUtils")
9
+
10
+ local MarketplaceServiceCache = {}
11
+ MarketplaceServiceCache.ServiceName = "MarketplaceServiceCache"
12
+
13
+ function MarketplaceServiceCache:Init(serviceBag)
14
+ assert(not self._serviceBag, "Already initialized")
15
+ self._serviceBag = assert(serviceBag, "No serviceBag")
16
+
17
+ self:_ensureInit()
18
+ end
19
+
20
+ function MarketplaceServiceCache:PromiseProductInfo(productId, infoType)
21
+ assert(type(productId) == "number", "Bad productId")
22
+
23
+ self:_ensureInit()
24
+
25
+ return self._promiseProductInfo(productId, infoType)
26
+ end
27
+
28
+ function MarketplaceServiceCache:_ensureInit()
29
+ if self._promiseProductInfo then
30
+ return
31
+ end
32
+
33
+ self._promiseProductInfo = MemorizeUtils.memoize(MarketplaceUtils.promiseProductInfo)
34
+ end
35
+
36
+ return MarketplaceServiceCache