Skip to content

Instantly share code, notes, and snippets.

View Dmitriy-8-Kireev's full-sized avatar
🎧
Working

DmytriyKireev Dmitriy-8-Kireev

🎧
Working
  • Moscow
View GitHub Profile
@Dmitriy-8-Kireev
Dmitriy-8-Kireev / app-api
Last active December 8, 2018 17:20
Набор универсальных фун-ий в app.js
import React, { Component } from "react";
import axios from "axios";
const DEFAULT_QUERY = "redux";
const DEFAULT_HPP = "100";
const PATH_BASE = "https://hn.algolia.com/api/v1";
const PATH_SEARCH = "/search";
const PARAM_SEARCH = "query=";
const PARAM_PAGE = "page=";
@Dmitriy-8-Kireev
Dmitriy-8-Kireev / index.js
Last active August 4, 2020 13:37
Cтандарты языка ECMAScript 2019 + Важные правила React and Redux
const defaultOpts = {
host: "local",
name: "user",
user: "admin"
};
const opts = {
host: "local",
name: "Dick",
user: "Dick",
password: "1234"
@Dmitriy-8-Kireev
Dmitriy-8-Kireev / Readme.md
Last active December 5, 2018 15:50
Основы визуально

Пример с классом

1543934377102

Используем функцию, а не класс, props передается аргументом функции:

1543934903985

State и setState

@Dmitriy-8-Kireev
Dmitriy-8-Kireev / Readme.md
Last active March 11, 2019 19:14
Основы Redux визуально

g2ys4ntpnsw

1544033336593 1544033432232

1544033586542

Store API, состоящий всего из четырех методов:

1544032696157

@Dmitriy-8-Kireev
Dmitriy-8-Kireev / key-and-api.js
Last active January 13, 2019 16:28
1)Варианты присваивания id ключам + map 2) Api для проекта с трансформациями
// Первый вариант
{list.map(function (item) {
return (
# leanpub-start-insert
<div key={item.objectID}>
# leanpub-end-insert
<span>
<a href={item.url}>{item.title}</a>
</span>
<span>{item.author}</span>
//
//INDEX.JS
//
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from 'components/App';
import { Provider } from 'react-redux';
import createStore from './store';
// INDEX.JS
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import AppRouter from 'components/AppRouter';
import getStore from './store';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
const store = getStore();
@Dmitriy-8-Kireev
Dmitriy-8-Kireev / 1.js
Last active December 29, 2018 15:10
map
//
//app.js
//
import React, { Component } from "react";
import { helloWorld, List } from "./lets";
class App extends Component {
render() {
return (
<div className="App">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.0.8/es5-shim.min.js"></script>
<script src="https://cdn.rawgit.com/zloirock/core-js/master/client/shim.min.js"></script>