Make this more readable

This commit is contained in:
Lim Chee Aun 2023-09-10 15:29:52 +08:00
parent 2d94f229c3
commit a0f16057a0

View file

@ -30,7 +30,8 @@ export default function useTitle(title, path) {
}
useLayoutEffect(() => {
const unsub = subscribeKey(states, 'currentLocation', setTitle);
setTitle();
return subscribeKey(states, 'currentLocation', setTitle);
return unsub;
}, [title, path]);
}