(getState: () => IStoreState)
| 2 | import {IStoreState} from '../store'; |
| 3 | |
| 4 | const updateTitle = (getState: () => IStoreState) => { |
| 5 | const {config, isLoading} = getState(); |
| 6 | |
| 7 | const update_title = config?.update_title; |
| 8 | |
| 9 | if (!update_title) { |
| 10 | return; |
| 11 | } |
| 12 | |
| 13 | if (isLoading) { |
| 14 | if (document.title !== update_title) { |
| 15 | observer.title = document.title; |
| 16 | document.title = update_title; |
| 17 | } |
| 18 | } else { |
| 19 | if (document.title === update_title) { |
| 20 | document.title = observer.title; |
| 21 | } else { |
| 22 | observer.title = document.title; |
| 23 | } |
| 24 | } |
| 25 | }; |
| 26 | |
| 27 | const observer: IStoreObserverDefinition<IStoreState> = { |
| 28 | inputs: ['isLoading'], |
no test coverage detected
searching dependent graphs…