Refactor useToast hook into modules
The useToast hook was refactored into smaller, more manageable modules.
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
import { Action, actionTypes } from './types'
|
||||
import { TOAST_LIMIT } from './constants'
|
||||
import { reducer } from './reducer'
|
||||
import { listeners, memoryState, lastAction } from './store'
|
||||
import { listeners } from './store'
|
||||
|
||||
// 전역 상태 관리
|
||||
let memoryState = { toasts: [] };
|
||||
let lastAction = null;
|
||||
|
||||
// ID 생성기
|
||||
let count = 0
|
||||
@@ -49,3 +53,5 @@ export function dispatch(action: Action) {
|
||||
listener(memoryState)
|
||||
})
|
||||
}
|
||||
|
||||
export { memoryState };
|
||||
|
||||
Reference in New Issue
Block a user