Explorar el Código

Fix bug with BehaviorSubjects and multiple return values;

bjorn hace 10 años
padre
commit
816046fb3e
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      rx.lua

+ 4 - 2
rx.lua

@@ -1264,7 +1264,9 @@ end
 -- if nothing has been emitted yet.
 -- @returns {*...}
 function BehaviorSubject:getValue()
-  return self.value and util.unpack(self.value)
+  if self.value then
+    return util.unpack(self.value)
+  end
 end
 
 return {
@@ -1276,4 +1278,4 @@ return {
   CooperativeScheduler = CooperativeScheduler,
   Subject = Subject,
   BehaviorSubject = BehaviorSubject
-}
+}