Skip to content

Fix Operator Subscription error

Choose a tag to compare

@kurapica kurapica released this 17 Mar 16:01
· 25 commits to master since this release
require "PLoop" (function(_ENV)
	Logger.Default:AddHandler(print)

	subject = Subject()

	local ob
	observable = Observable(function(observer)
		return subject:Subscribe(observer)
	end)

	observable:Map("x => x ^ 2"):Dump()

	subject:OnNext(1)
	subject:OnNext(2)
end)

For code like this, the operator(like Map)'s Subscription assignment is incorrect, will auto cancel the subscription, fixed.