feat(Flash): Normalize flash types with object
help prevent typo errors
This commit is contained in:
10
common/utils/flash.js
Normal file
10
common/utils/flash.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
export const alertTypes = _.keyBy([
|
||||
'success',
|
||||
'info',
|
||||
'warning',
|
||||
'danger'
|
||||
], _.identity);
|
||||
|
||||
export const normalizeAlertType = alertType => alertTypes[alertType] || 'info';
|
||||
Reference in New Issue
Block a user