()
| 5 | import { userThemeSelector } from './selectors'; |
| 6 | |
| 7 | function* toggleThemeSaga() { |
| 8 | const data = { type: 'success', message: 'flash.updated-themes' }; |
| 9 | const currentTheme = localStorage.getItem('theme'); |
| 10 | const invertedTheme = currentTheme === 'dark' ? 'light' : 'dark'; |
| 11 | localStorage.setItem('theme', invertedTheme); |
| 12 | yield put(setTheme(invertedTheme)); |
| 13 | yield put(createFlashMessage({ ...data })); |
| 14 | } |
| 15 | |
| 16 | export function* initializeThemeSaga() { |
| 17 | // Wait for the fetch userComplete action |
nothing calls this directly
no test coverage detected