17 lines
416 B
JavaScript
17 lines
416 B
JavaScript
![]() |
// (doc: Object) =>
|
||
|
// () =>
|
||
|
// (next: (action: Action) => Object) =>
|
||
|
// titleSage(action: Action) => Object|Void
|
||
|
export default (doc) => () => next => {
|
||
|
return function titleSage(action) {
|
||
|
// get next state
|
||
|
const result = next(action);
|
||
|
if (action !== 'updateTitle') {
|
||
|
return result;
|
||
|
}
|
||
|
const newTitle = result.app.title;
|
||
|
doc.title = newTitle;
|
||
|
return result;
|
||
|
};
|
||
|
};
|