local R=require(script.Parent.Parent.DataStoreServiceRetriever)local k=require(script.Parent.Parent.Promise)local t={}t.__index=t function t.Get(R)return k.async(function(k)k(R.dataStore:GetAsync(R.userId))end)end function t.Set(t,R)return k.async(function(k)t.dataStore:UpdateAsync(t.userId,function()return R end)k()end)end function t.new(k)return setmetatable({dataStore=(R.Get()):GetDataStore(k.Name),userId=k.UserId},t)end return t

local DataStoreServiceRetriever = require(script.Parent.Parent.DataStoreServiceRetriever)
local Promise = require(script.Parent.Parent.Promise)

local Standard = {}
Standard.__index = Standard

function Standard:Get()
	return Promise.async(function(resolve)
		resolve(self.dataStore:GetAsync(self.userId))
	end)
end

function Standard:Set(value)
	return Promise.async(function(resolve)
		self.dataStore:UpdateAsync(self.userId, function()
			return value
		end)

		resolve()
	end)
end

function Standard.new(dataStore2)
	return setmetatable({
		dataStore = DataStoreServiceRetriever.Get():GetDataStore(dataStore2.Name),
		userId = dataStore2.UserId,
	}, Standard)
end

return Standard
