This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Написать приложение для работы с REST сервисом, | |
все функции делают запрос и возвращают Promise | |
с которым потом можно работать. | |
Реализовать следующий функционал: | |
- функция getAllUsers() - должна вернуть текущий список всех пользователей в БД. | |
- функция getUserById(id) - должна вернуть пользователя с переданным id. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Напишите приложение для хранения url веб-страниц в виде карточек-закладок. | |
Реализуйте следующий функционал: | |
- Используйте Gulp для сборки проекта, JS обработан транспайлером Babel, ресурсы оптимизированы | |
- Для добавления новой закладки, в приложении есть форма с элементом input и кнопкой "Добавить" | |
- В приложении есть список всех добавленных карточек-закладок, располагающийся под формой | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Возьмите домашнее задание №12 и перепишите его ипользуя паттерн MVC. | |
Вынесите отдельно логику, отдельно представление и реакцию на действия пользователя. | |
Model, View и Controller вынести в отдельные файлы и сделать классами. | |
Используйте ES6 модули и Webpack для сборки. | |
Использование будет выглядеть следующим образом. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Напишите тесты к приложению из домашней работы номер 13. | |
Постарайтесь покрыть тестами как можно больше методов в Model. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch('https://api.ipify.org?format=json') | |
.then(response => { | |
if (response.ok) return response.json(); | |
throw Error('Error while fetching' + response.statusText); | |
}) | |
.then(data => console.log(data)) | |
.catch(err => console.log(err)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Converts png and jpg into webP | |
gulp.task('webp', () => { | |
return gulp | |
.src('./src/img/**/*.{png,jpg,jpeg}') | |
.pipe(webp({ quality: 90 })) | |
.pipe(gulp.dest('./build/img')); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getTimeToInteractive() { | |
const { requestStart, domInteractive } = window.performance.timing; | |
return requestStart - domInteractive; | |
} | |
function getResourceEntries() { | |
return window.performance.getEntriesByType('resource') || []; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Can prefetch css and js | |
function prefetchResource(resourceUrl) { | |
const xhrRequest = new XMLHttpRequest(); | |
xhrRequest.open('GET', resourceUrl, true); | |
xhrRequest.send(); | |
} | |
// Can prefetch everything but support in not great, use for HTML | |
// <link rel="prefetch" href="path-to-content"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"printWidth": 100, | |
"tabWidth": 2, | |
"useTabs": false, | |
"semi": true, | |
"singleQuote": true, | |
"trailingComma": "es5", | |
"bracketSpacing": true, | |
"jsxBracketSameLine": false, | |
"arrowParens": "avoid", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Install packages | |
// npm install --save-dev prettier eslint-config-airbnb eslint-config-prettier eslint-plugin-prettier eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y husky lint-staged | |
{ | |
"extends": [ | |
"eslint:recommended", | |
"react-app", | |
"airbnb", | |
"plugin:import/errors", | |
"plugin:react/recommended", |