DS
Size: a a a
DS
NF
fetchClientFx.doneData.map(({ type, entityId }) => fetchFactory(type)(entityId));
function fetchFactory(type: AccountType) {
switch(type) {
case AccountType.Bank: return fetchBankFx;
case AccountType.Company: return fetchCompanyFx;
case AccountType.Individual: return fetchIndividualFx;
}
}
function toEntityId({ entityId }) {
return entityId;
}NF
DS
fetchClientFx.doneData.map(({ type, entityId }) => fetchFactory(type)(entityId));
function fetchFactory(type: AccountType) {
switch(type) {
case AccountType.Bank: return fetchBankFx;
case AccountType.Company: return fetchCompanyFx;
case AccountType.Individual: return fetchIndividualFx;
}
}
function toEntityId({ entityId }) {
return entityId;
}DS
A
fetchClientFx.doneData.map(({ type, entityId }) => fetchFactory(type)(entityId));
function fetchFactory(type: AccountType) {
switch(type) {
case AccountType.Bank: return fetchBankFx;
case AccountType.Company: return fetchCompanyFx;
case AccountType.Individual: return fetchIndividualFx;
}
}
function toEntityId({ entityId }) {
return entityId;
}map -> watchA
fetchClientFx.doneData.map(({ type, entityId }) => fetchFactory(type)(entityId));
function fetchFactory(type: AccountType) {
switch(type) {
case AccountType.Bank: return fetchBankFx;
case AccountType.Company: return fetchCompanyFx;
case AccountType.Individual: return fetchIndividualFx;
}
}
function toEntityId({ entityId }) {
return entityId;
}const match = (target) => ({type}) => target === type;
const withId = (fx) => fx.prepend(({entityId}) => entityId)
split({
source: fxFetchAccount,
match: {
bank: match(AccountType.Bank),
company: match(AccountType.Company),
individual: match(AccountType.Individual),
},
cases: {
bank:withId(fetchBankFx)
company: withId(fetchCompanyFx),
individual: withId(fetchIndividualFx),
}
});ф
split({
source: fetchClientFx.doneData.map(({ entityId }) => entityId),
match: {
bank: ({ type }) => type === AccountType.Bank,
company: ({ type }) => type === AccountType.Company,
individual: ({ type }) => type === AccountType.Individual,
},
cases: {
bank: fetchBankFx,
company: fetchCompanyFx,
individual: fetchIndividualFx,
},
})fn обрабатывать данные перед отправкой в таргеты, но эту фичу ещё не добавилиф
const match = (target) => ({type}) => target === type;
const withId = (fx) => fx.prepend(({entityId}) => entityId)
split({
source: fxFetchAccount,
match: {
bank: match(AccountType.Bank),
company: match(AccountType.Company),
individual: match(AccountType.Individual),
},
cases: {
bank:withId(fetchBankFx)
company: withId(fetchCompanyFx),
individual: withId(fetchIndividualFx),
}
});split({
source: fxFetchAccount,
key: ({type}) => type,
fn: ({entityId}) => entityId,
cases: {
bank: fetchBankFx,
company: fetchCompanyFx,
individual: fetchIndividualFx,
}
})NF
fetchClientFx.doneData.map(({ type, entityId }) => fetchFactory(type)(entityId));
function fetchFactory(type: AccountType) {
switch(type) {
case AccountType.Bank: return fetchBankFx;
case AccountType.Company: return fetchCompanyFx;
case AccountType.Individual: return fetchIndividualFx;
}
}
function toEntityId({ entityId }) {
return entityId;
}A
split({
source: fxFetchAccount,
key: ({type}) => type,
fn: ({entityId}) => entityId,
cases: {
bank: fetchBankFx,
company: fetchCompanyFx,
individual: fetchIndividualFx,
}
})A
ф
fetchClientFx.doneData.map(({ type, entityId }) => fetchFactory(type)(entityId));
function fetchFactory(type: AccountType) {
switch(type) {
case AccountType.Bank: return fetchBankFx;
case AccountType.Company: return fetchCompanyFx;
case AccountType.Individual: return fetchIndividualFx;
}
}
function toEntityId({ entityId }) {
return entityId;
}ф
A
split({
source: fxFetchAccount.doneData,
key: ({type}) => type,
fn: ({entityId}) => entityId,
cases: {
[AccountType.Bank]: fetchBankFx,
[AccountType.Company]: fetchCompanyFx,
[AccountType.Individual]: fetchIndividualFx,
}
})ф
split({
source: fxFetchAccount.doneData,
key: ({type}) => type,
fn: ({entityId}) => entityId,
cases: {
[AccountType.Bank]: fetchBankFx,
[AccountType.Company]: fetchCompanyFx,
[AccountType.Individual]: fetchIndividualFx,
}
})NF
fetchClientFx.doneData.watch(({ type, entityId }) => fetchFactory(type)(entityId));
function fetchFactory(type: AccountType) {
switch(type) {
case AccountType.Bank: return fetchBankFx;
case AccountType.Company: return fetchCompanyFx;
case AccountType.Individual: return fetchIndividualFx;
}
}NF
split({
source: fxFetchAccount.doneData,
key: ({type}) => type,
fn: ({entityId}) => entityId,
cases: {
[AccountType.Bank]: fetchBankFx,
[AccountType.Company]: fetchCompanyFx,
[AccountType.Individual]: fetchIndividualFx,
}
})A
DS
fetchClientFx.doneData.watch(({ type, entityId }) => fetchFactory(type)(entityId));
function fetchFactory(type: AccountType) {
switch(type) {
case AccountType.Bank: return fetchBankFx;
case AccountType.Company: return fetchCompanyFx;
case AccountType.Individual: return fetchIndividualFx;
}
}