function Blend.State(G)return ValueObject.new(G)end function Blend.Dynamic(...)return(Blend.Computed(...)):Pipe({Rx.switchMap(function(G,...)if Promise.isPromise(G)then return Rx.fromPromise(G)elseif Observable.isObservable(G)then return G else return Rx.of(G,...)end end)})end
--[=[
	Creates a new Blend State which is actually just a ValueObject underneath.

	@param defaultValue T
	@return ValueObject<T>
]=]
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
