function Blend.State(l)return ValueObject.new(l)end function Blend.Dynamic(...)return(Blend.Computed(...)):Pipe({Rx.switchMap(function(l,...)if Promise.isPromise(l)then return Rx.fromPromise(l)elseif Observable.isObservable(l)then return l else return Rx.of(l,...)end end)})end

function Blend.State(defaultValue)
	return ValueObject.new(defaultValue)
end

function Blend.Dynamic(...)
	return Blend.Computed(...)
		:Pipe({
			-- This switch map is relatively expensive, so we don't do this for defaul computed
			-- and instead force the user to switch to another promise
			Rx.switchMap(function(promise, ...)
				if Promise.isPromise(promise) then
					return Rx.fromPromise(promise)
				elseif Observable.isObservable(promise) then
					return promise
				else
					return Rx.of(promise, ...)
				end
			end)
		})
end
