Files
gameserver/RCCService2018/content/LuaPackages/AppTempCommon/LuaApp/Thunks/ApiFetchUsersFriendCount.lua
T
2026-07-06 14:01:11 -04:00

21 lines
587 B
Lua

local CorePackages = game:GetService("CorePackages")
local Actions = CorePackages.AppTempCommon.LuaApp.Actions
local Requests = CorePackages.AppTempCommon.LuaApp.Http.Requests
local UsersGetFriendCount = require(Requests.UsersGetFriendCount)
local SetFriendCount = require(Actions.SetFriendCount)
return function(networkImpl)
return function(store)
return UsersGetFriendCount(networkImpl):andThen(function(result)
local data = result.responseBody
if data.success and data.count then
store:dispatch(SetFriendCount(data.count))
end
return data.count
end)
end
end