--[=[
	Initializes a new promise with the given function in a spawn wrapper.

	@param func (resolve: (...) -> (), reject: (...) -> ()) -> ()?
	@return Promise<T>
]=]

function Promise.spawn(func)
	local self = Promise.new()

	task.spawn(func, self:_getResolveReject())

	return self
end
