Skip to content

Instantly share code, notes, and snippets.

View iurevych's full-sized avatar
💭
Helping great companies grow 🚀

Sergii Iurevych iurevych

💭
Helping great companies grow 🚀
View GitHub Profile
require("./app.scss");
import React from "react";
import ReactDOM from "react-dom";
import createReactClass from "create-react-class";
import ColorPicker from "../../src/";
import ColorSwatch from "./ColorSwatch";
import colors from "./colors.json";
export const SomeStore = types
.model('SomeStore', {
settings: types.optional(Settings, {}),
key1: '',
key2: false,
})
.actions(self => ({
load: () => {
makeYourAjaxCall().then(response => self.update(response.data))
},
// Функция принимает всего лишь один аргумент: порядковый номер коммента, который надо найти
// Она сама тыкает на плюсик если надо еще подгрузить комеентов
// Найденный коммент выделяется желтым и страница сама к нему проскролится
// With <3 from iurevych
function findComment(commentToFind) {
const commentsCount = document.querySelectorAll('ul [role="button"]').length - 1
if (commentsCount < (commentToFind - 1)) {
const expandMore = document.querySelector('[aria-label="Load more comments"]')