function DataStore.Save(v)if v:DidLoadFail()then warn("\091\068\097\116\097\083\116\111\114\101\093 - \078\111\116 \115\097\118\105\110\103\044 \102\097\105\108\101\100 \116\111 \108\111\097\100")return Promise.rejected("\076\111\097\100 \110\111\116 \115\117\099\099\101\115\115\102\117\108\044 \110\111\116 \115\097\118\105\110\103")end if DEBUG_WRITING then print("\091\068\097\116\097\083\116\111\114\101\046\083\097\118\101\093 - \083\116\097\114\116\105\110\103 \115\097\118\101 \114\111\117\116\105\110\101")end return(v:_promiseInvokeSavingCallbacks()or Promise.resolved()):Then(function()if not v:HasWritableData()then if DEBUG_WRITING then print("\091\068\097\116\097\083\116\111\114\101\046\083\097\118\101\093 - \078\111\116 \115\097\118\105\110\103\044 \110\111\116\104\105\110\103 \115\116\097\103\101\100")end return nil else return v:_saveData(v:GetNewWriter())end end)end

function DataStore:Save()
	if self:DidLoadFail() then
		warn("[DataStore] - Not saving, failed to load")
		return Promise.rejected("Load not successful, not saving")
	end

	if DEBUG_WRITING then
		print("[DataStore.Save] - Starting save routine")
	end

	-- Avoid constructing promises for every callback down the datastore
	-- upon save.
	return (self:_promiseInvokeSavingCallbacks() or Promise.resolved())
		:Then(function()
			if not self:HasWritableData() then
				-- Nothing to save, don't update anything
				if DEBUG_WRITING then
					print("[DataStore.Save] - Not saving, nothing staged")
				end
				return nil
			else
				return self:_saveData(self:GetNewWriter())
			end
		end)
end
