Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Misc modules/* cleanup #22983

Merged
merged 4 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 24 additions & 25 deletions docs/src/modules/components/Notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import ClickAwayListener from '@material-ui/core/ClickAwayListener';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import Divider from '@material-ui/core/Divider';
import sleep from 'modules/waterfall/sleep';
import { getCookie } from 'docs/src/modules/utils/helpers';
import { ACTION_TYPES } from 'docs/src/modules/constants';

Expand Down Expand Up @@ -91,33 +90,33 @@ export default function Notifications() {
return undefined;
}

(async () => {
await sleep(1500); // Soften the pressure on the main thread.
let newMessages;
try {
const result = await fetch(
'https://raw.githubusercontent.com/mui-org/material-ui/master/docs/notifications.json',
);
newMessages = await result.json();
} catch (err) {
// Swallow the exceptions, e.g. rate limit
}

if (active) {
const seen = getCookie('lastSeenNotification');
const lastSeenNotification = seen === '' ? 0 : parseInt(seen, 10);

dispatch({
type: ACTION_TYPES.NOTIFICATIONS_CHANGE,
payload: {
messages: newMessages || [],
lastSeen: lastSeenNotification,
},
// Soften the pressure on the main thread.
const timeout = setTimeout(() => {
fetch('https://raw.githubusercontent.com/mui-org/material-ui/master/docs/notifications.json')
.then((response) => {
return response.json();
})
.catch(() => {
// Swallow the exceptions, e.g. rate limit
return [];
})
.then((newMessages) => {
if (active) {
const seen = getCookie('lastSeenNotification');
const lastSeenNotification = seen === '' ? 0 : parseInt(seen, 10);
dispatch({
type: ACTION_TYPES.NOTIFICATIONS_CHANGE,
payload: {
messages: newMessages || [],
lastSeen: lastSeenNotification,
},
});
}
});
}
})();
}, 1500);

return () => {
clearTimeout(timeout);
active = false;
};
}, []);
Expand Down
112 changes: 0 additions & 112 deletions modules/handleKillSignals.js

This file was deleted.

146 changes: 0 additions & 146 deletions modules/log.js

This file was deleted.

47 changes: 0 additions & 47 deletions modules/waterfall/Batcher.js

This file was deleted.

8 changes: 0 additions & 8 deletions modules/waterfall/forEach.js

This file was deleted.

Loading