diff --git a/src/observablecollection/src/Shared/SortedList/ObservableSortedList.lua b/src/observablecollection/src/Shared/SortedList/ObservableSortedList.lua index 358610d412..43361f8438 100644 --- a/src/observablecollection/src/Shared/SortedList/ObservableSortedList.lua +++ b/src/observablecollection/src/Shared/SortedList/ObservableSortedList.lua @@ -20,6 +20,7 @@ local require = require(script.Parent.loader).load(script) local Brio = require("Brio") local DuckTypeUtils = require("DuckTypeUtils") +local ListIndexUtils = require("ListIndexUtils") local Maid = require("Maid") local Observable = require("Observable") local ObservableSubscriptionTable = require("ObservableSubscriptionTable") @@ -27,9 +28,8 @@ local Rx = require("Rx") local Signal = require("Signal") local SortedNode = require("SortedNode") local SortedNodeValue = require("SortedNodeValue") -local ValueObject = require("ValueObject") local SortFunctionUtils = require("SortFunctionUtils") -local ListIndexUtils = require("ListIndexUtils") +local ValueObject = require("ValueObject") local ObservableSortedList = {} ObservableSortedList.ClassName = "ObservableSortedList" @@ -116,7 +116,11 @@ end @return Observable<{ T }> ]=] function ObservableSortedList:Observe() - return self._mainObservables:Observe("list") + return self._mainObservables:Observe("list"):Pipe({ + Rx.start(function() + return self:GetList() + end) + }) end --[=[ diff --git a/src/rx/src/Shared/Rx.lua b/src/rx/src/Shared/Rx.lua index c54053d7ef..0f5804bf6c 100644 --- a/src/rx/src/Shared/Rx.lua +++ b/src/rx/src/Shared/Rx.lua @@ -1448,14 +1448,12 @@ function Rx.combineLatest(observables) assert(type(observables) == "table", "Bad observables") return Observable.new(function(sub) - local pending = 0 local unset = 0 local latest = {} -- Instead of caching this, use extra compute here for key, value in pairs(observables) do if Observable.isObservable(value) then - pending += 1 unset += 1 latest[key] = UNSET_VALUE else @@ -1463,12 +1461,13 @@ function Rx.combineLatest(observables) end end - if pending == 0 then + if unset == 0 then sub:Fire(latest) sub:Complete() return end + local pending = unset local maid = Maid.new() local function failOnFirst(...) diff --git a/src/settings/package.json b/src/settings/package.json index 68a514a0c8..c43ee98b3d 100644 --- a/src/settings/package.json +++ b/src/settings/package.json @@ -33,6 +33,7 @@ "@quenty/datastore": "file:../datastore", "@quenty/ducktype": "file:../ducktype", "@quenty/enumutils": "file:../enumutils", + "@quenty/instanceutils": "file:../instanceutils", "@quenty/jsonutils": "file:../jsonutils", "@quenty/loader": "file:../loader", "@quenty/maid": "file:../maid", diff --git a/src/table/src/Shared/Table.lua b/src/table/src/Shared/Table.lua index b12a9a0b79..feaee6375f 100644 --- a/src/table/src/Shared/Table.lua +++ b/src/table/src/Shared/Table.lua @@ -339,6 +339,17 @@ function Table.readonly(target) return table.freeze(setmetatable(target, READ_ONLY_METATABLE)) end +--[=[ + Sets a metatable on a table such that it errors when + indexing a nil value + + @param target table -- Table to error on indexing + @return table -- The same table, with the target set to error on nil +]=] +function Table.errorOnNilIndex(target) + return setmetatable(target, READ_ONLY_METATABLE) +end + --[=[ Recursively sets the table as ReadOnly diff --git a/src/templateprovider/package.json b/src/templateprovider/package.json index 64f952ca20..6fc35a67dc 100644 --- a/src/templateprovider/package.json +++ b/src/templateprovider/package.json @@ -37,7 +37,8 @@ "@quenty/promise": "file:../promise", "@quenty/promisemaid": "file:../promisemaid", "@quenty/rx": "file:../rx", - "@quenty/string": "file:../string" + "@quenty/string": "file:../string", + "@quenty/table": "file:../table" }, "publishConfig": { "access": "public"