Added getToasts selector

• Added:
- getToasts selector
This commit is contained in:
mgabdev 2020-08-05 23:24:36 -05:00
parent 12ca5db281
commit 75ddf2d9e7

View File

@ -165,4 +165,22 @@ export const getOrderedLists = createSelector([state => state.get('lists')], lis
if (!lists) return lists
return lists.toList().filter(item => !!item).sort((a, b) => a.get('title').localeCompare(b.get('title')))
})
export const getToasts = createSelector([
(state) => state.get('toasts'),
], (base) => {
if (!base) return null
let arr = []
base.forEach(item => {
arr.push({
message: item.get('message'),
type: item.get('type'),
key: item.get('key'),
})
})
return arr
})