freeCodeCamp/client/sagas/title-saga.js

11 lines
294 B
JavaScript
Raw Normal View History

2016-04-25 04:54:48 +00:00
export default function titleSage(action$, getState, { document }) {
return action$
.filter(action => action.type === 'app.updateTitle')
.map(() => {
const state = getState();
const newTitle = state.app.title;
document.title = newTitle;
return null;
});
}