Skip to content

Instantly share code, notes, and snippets.

View dhutaryan's full-sized avatar

Dzmitry Hutaryan dhutaryan

  • Sigli
  • Warsaw, Poland
View GitHub Profile
@dhutaryan
dhutaryan / .eslintrc
Last active April 13, 2023 09:35
Feature-Sliced Design - typersctipt + eslint + vite
{
"plugins": ["boundaries"],
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:boundaries/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
const MAX_PAGES_BLOCK = 3;
const SIDE_PAGE_COUNT = (MAX_PAGES_BLOCK - 1) / 2;
getPages() {
if (this.totalPages <= MAX_PAGES_BLOCK + 1) {
return this.range(1, this.totalPages);
}
const leftSidePages = this.getLeftSidePages();
const rightSidePages = this.getRightSidePages();
const singleton = (function() {
let instance;
function init() {
let count = 0;
return {
getValue,
increase
};