DS
Наверное 🤷♂️
Size: a a a
DS
DS
l
🚀🚀
DS

l
// Create effect that send only authorized requests
const requestAuthorizedFx = attach({
source: $token,
effect: requestInternalFx,
mapParams: ({ headers, ...config }: RequestInternal, token) => {
// Here we need to construct params for requestInternalFx
// If no token, just throw an custom error
if (!token) {
throw new AccessRestrictedError('authorization token required')
}
const headersAuth = { ...headers, Authorization: `Bearer ${token}` }
return { ...config, headers: headersAuth }
},
})
l
if (!token) {
throw new AccessRestrictedError('authorization token required')
}DS
R
🚀🚀
yv
l
l
yv
🚀🚀
DS
conventions) все остальное советы))K