lint
This commit is contained in:
parent
13cd56dabc
commit
c0db949a53
7 changed files with 53 additions and 38 deletions
src/redux/selectors
|
@ -1,26 +1,32 @@
|
|||
import { createSelector } from 'reselect';
|
||||
|
||||
export const selectState = (state) => state.notifications || {};
|
||||
export const selectState = state => state.notifications || {};
|
||||
|
||||
export const selectToast = createSelector(selectState, (state) => {
|
||||
if (state.toasts.length) {
|
||||
const { id, params } = state.toasts[0];
|
||||
return {
|
||||
id,
|
||||
...params,
|
||||
};
|
||||
export const selectToast = createSelector(
|
||||
selectState,
|
||||
state => {
|
||||
if (state.toasts.length) {
|
||||
const { id, params } = state.toasts[0];
|
||||
return {
|
||||
id,
|
||||
...params,
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
);
|
||||
|
||||
return null;
|
||||
});
|
||||
export const selectError = createSelector(
|
||||
selectState,
|
||||
state => {
|
||||
if (state.errors.length) {
|
||||
const { error } = state.errors[0];
|
||||
return {
|
||||
error,
|
||||
};
|
||||
}
|
||||
|
||||
export const selectError = createSelector(selectState, (state) => {
|
||||
if (state.errors.length) {
|
||||
const { error } = state.errors[0];
|
||||
return {
|
||||
error,
|
||||
};
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue