@quenty/observablecollection 9.0.1-canary.445.bf8e4c3.0 → 9.0.1-canary.445.ee7e5d6.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,13 +3,12 @@
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.0.1-canary.445.bf8e4c3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/observablecollection@9.0.0...@quenty/observablecollection@9.0.1-canary.445.bf8e4c3.0) (2024-02-14)
6
+ ## [9.0.1-canary.445.ee7e5d6.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/observablecollection@9.0.0...@quenty/observablecollection@9.0.1-canary.445.ee7e5d6.0) (2024-02-14)
7
7
 
8
8
 
9
9
  ### Bug Fixes
10
10
 
11
11
  * Fix bootstrap of test environments and loader samples ([441e4a9](https://github.com/Quenty/NevermoreEngine/commit/441e4a90d19fcc203da2fdedc08e532c20d52f99))
12
- * Fix sorting errors ([43ac468](https://github.com/Quenty/NevermoreEngine/commit/43ac468dd49147011c04e9d61e08573fb543423c))
13
12
 
14
13
 
15
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/observablecollection",
3
- "version": "9.0.1-canary.445.bf8e4c3.0",
3
+ "version": "9.0.1-canary.445.ee7e5d6.0",
4
4
  "description": "A set of observable collections, such as sets, maps, sorted lists, and more.",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -27,23 +27,23 @@
27
27
  "Quenty"
28
28
  ],
29
29
  "dependencies": {
30
- "@quenty/baseobject": "8.0.1-canary.445.bf8e4c3.0",
31
- "@quenty/brio": "12.0.1-canary.445.bf8e4c3.0",
32
- "@quenty/ducktype": "3.0.1-canary.445.bf8e4c3.0",
33
- "@quenty/loader": "8.0.1-canary.445.bf8e4c3.0",
30
+ "@quenty/baseobject": "8.0.1-canary.445.ee7e5d6.0",
31
+ "@quenty/brio": "12.0.1-canary.445.ee7e5d6.0",
32
+ "@quenty/ducktype": "3.0.1-canary.445.ee7e5d6.0",
33
+ "@quenty/loader": "8.0.1-canary.445.ee7e5d6.0",
34
34
  "@quenty/maid": "3.0.0",
35
- "@quenty/promise": "8.0.1-canary.445.bf8e4c3.0",
36
- "@quenty/rx": "11.0.1-canary.445.bf8e4c3.0",
37
- "@quenty/signal": "5.0.1-canary.445.bf8e4c3.0",
35
+ "@quenty/promise": "8.0.1-canary.445.ee7e5d6.0",
36
+ "@quenty/rx": "11.0.1-canary.445.ee7e5d6.0",
37
+ "@quenty/signal": "5.0.1-canary.445.ee7e5d6.0",
38
38
  "@quenty/steputils": "3.3.0",
39
39
  "@quenty/symbol": "3.0.0",
40
- "@quenty/valueobject": "11.0.1-canary.445.bf8e4c3.0"
40
+ "@quenty/valueobject": "11.0.1-canary.445.ee7e5d6.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@quenty/blend": "10.0.1-canary.445.bf8e4c3.0"
43
+ "@quenty/blend": "10.0.1-canary.445.ee7e5d6.0"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "bf8e4c3cbff3de4e4c7ffbfc768c1f7ae2ff9e42"
48
+ "gitHead": "ee7e5d6ada857eba67b462aa37a00de9f430ae97"
49
49
  }
@@ -15,14 +15,7 @@ FilteredObservableListView.__index = FilteredObservableListView
15
15
 
16
16
  -- Higher numbers last
17
17
  local function defaultCompare(a, b)
18
- -- equivalent of `return a - b` except it supports comparison of strings and stuff
19
- if b > a then
20
- return -1
21
- elseif b < a then
22
- return 1
23
- else
24
- return 0
25
- end
18
+ return a < b
26
19
  end
27
20
 
28
21
  function FilteredObservableListView.new(observableList, observeScoreCallback, compare)
@@ -32,14 +25,15 @@ function FilteredObservableListView.new(observableList, observeScoreCallback, co
32
25
  self._baseList = assert(observableList, "No observableList")
33
26
  self._observeScoreCallback = assert(observeScoreCallback, "No observeScoreCallback")
34
27
 
35
- self._scoredList = self._maid:Add(ObservableSortedList.new(false, function(a, b)
28
+ self._scoredList = ObservableSortedList.new(false, function(a, b)
36
29
  -- Preserve index when scoring does not
37
30
  if a.score == b.score then
38
31
  return a.index - b.index
39
32
  else
40
33
  return self._compare(a.score, b.score)
41
34
  end
42
- end))
35
+ end)
36
+ self._maid:GiveTask(self._scoredList)
43
37
 
44
38
  -- Shockingly this is somewhat performant because the sorted list defers all events
45
39
  -- to process the list reordering.
@@ -64,6 +58,8 @@ function FilteredObservableListView.new(observableList, observeScoreCallback, co
64
58
  return state
65
59
  end)
66
60
  }))
61
+
62
+
67
63
  end))
68
64
 
69
65
  return self
@@ -632,9 +632,7 @@ function ObservableSortedList:_highBinarySearch(sortValue)
632
632
  while true do
633
633
  local mid = math.floor((minIndex + maxIndex) / 2)
634
634
  local compareValue = self._compare(self._sortValue[self._keyList[mid]], sortValue)
635
- if type(compareValue) ~= "number" then
636
- error(string.format("Bad compareValue, expected number, got %q", type(compareValue)))
637
- end
635
+ assert(type(compareValue) == "number", "Expecting number")
638
636
 
639
637
  if self._isReversed then
640
638
  compareValue = -compareValue