a
Size: a a a
a
NS
a
IA
a
NS
store
и я из методов этого клиента диспатчу экшены уже после резолвинга промисаNS
NS
NS
NS
NS
store.getState(atom1)
, если atom1
еще не инициализировался в приложении, его initialState
же?a
store.getState(atom1)
, если atom1
еще не инициализировался в приложении, его initialState
же?IA
NS
NS
export const checkPrinter = declareAction<PrinterId>('checkPrinter', (payload, store) => {
const currentPrinterState = store.getState(printerAtom);
if (currentPrinterState.isFetching) {
return;
}
store.dispatch(startCheckPrinter());
ApiClient.checkPrinter(payload)
.then(response => {
const printerId = response.printerId;
store.dispatch(checkPrinterSuccess(printerId));
})
.catch((err: AxiosError) => {
if (err && err.response) {
const errAction = AddNotification({key: `${err.response.status}_printer`});
store.dispatch(errAction);
}
});
});
NS
NS
a
NS
a
export const checkPrinter = declareAction<PrinterId>('checkPrinter', (payload, store) => {
const currentPrinterState = store.getState(printerAtom);
if (currentPrinterState.isFetching) {
return;
}
store.dispatch(startCheckPrinter());
ApiClient.checkPrinter(payload)
.then(response => {
const printerId = response.printerId;
store.dispatch(checkPrinterSuccess(printerId));
})
.catch((err: AxiosError) => {
if (err && err.response) {
const errAction = AddNotification({key: `${err.response.status}_printer`});
store.dispatch(errAction);
}
});
});