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
[ | |
"Муравьед", | |
"Альбатрос", | |
"Аллигатор", | |
"Альпака", | |
"АНТ", | |
"Муравьед", | |
"Антилопы", | |
"Обезьяна", | |
"Армадилло", |
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 todoApp(state = initialState, action) { | |
switch (action.type) { | |
case SET_VISIBILITY_FILTER: | |
return Object.assign({}, state, { | |
visibilityFilter: action.filter | |
}) | |
case ADD_TODO: | |
return Object.assign({}, state, { | |
todos: [ | |
...state.todos, |
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
<Route path="/music" render={() =><Music/>}/> |
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
let OldArray =[{eng:"blabla",ru:"блабла"},{eng:"hello",ru:"привет"},{eng:"Hi",ru:"хай"}] | |
OldArray.map( word => (<Message eng={word.eng} ru={word.ru}/>)) |
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
let oldArray = ['saha','dasha','manya'] | |
let newArray = | |
oldArray.map(name => `<div>${name}</div>`) |
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
import React, { useState, useEffect } from 'react' | |
import axios from 'axios' | |
const User = () => { | |
const [user, setUser] = useState({}) | |
useEffect(() => { | |
axios.get('https://jsonplaceholder.typicode.com/users/1').then(it => { | |
setUser(it.data) | |
}) |
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
import React, { useState } from 'react' | |
import axios from 'axios' | |
import { useParams } from 'react-router-dom | |
const Category = () => { | |
const {category} = useParams() | |
const [value, setValue] = useState('') | |
const onChange = (event) => { |
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
in server.js | |
const user = new User({ | |
email: 'test@gmail.com', | |
password: 'abracadabra' | |
}) | |
user.save() |
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
export function setRepositories(username) { | |
return function (dispatch) { | |
fetch(`https://ap.github.com/users/${username}/repos`) | |
.then((r) => r.json()) | |
.then((list) => { | |
dispatch({ type: SET_REPOSITORIES, list }) | |
}) | |
} | |
} |
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
const UPDATE_USER_NAME = 'UPDATE_USER_NAME' | |
const initialState = { | |
username: 'ovas' | |
} | |
export default (state = initialState, action) => { | |
switch (action,type) { | |
case UPDATE_USER_NAME: | |
return { |
NewerOlder