This file contains hidden or 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 create from 'zustand'; | |
| const useStore = create((set) => ({ | |
| prop1: 1, | |
| prop2: 2, | |
| setProp1: (value) => { | |
| set({ prop1: value }); | |
| saveToLocalStorage({ prop1: value }); | |
| }, | |
| setProp2: (value) => { |
This file contains hidden or 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
| :host { | |
| .search-btn { | |
| background: theme('colors.white-1'); | |
| ::ng-deep tui-wrapper[data-appearance='outline']:after { | |
| @apply border-none; | |
| } | |
| } | |
| } |
This file contains hidden or 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 { | |
| AfterViewInit, | |
| ChangeDetectionStrategy, | |
| Component, | |
| EventEmitter, | |
| Input, | |
| OnDestroy, | |
| OnInit, | |
| Output, | |
| } from '@angular/core'; |
This file contains hidden or 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
| <!DOCTYPE html><html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"u= | |
| rn:schemas-microsoft-com:office:office" lang=3D"en"><head><title></title><m= | |
| eta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8"><met= | |
| a name=3D"viewport" content=3D"width=3Ddevice-width,initial-scale=3D1"><!--= | |
| [if mso]><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInc= | |
| h><o:AllowPNG/></o:OfficeDocumentSettings></xml><![endif]--><!--[if !mso]><= | |
| !--><link href=3D"https://fonts.googleapis.com/css?family=3DMontserrat"=20 | |
| rel=3D"stylesheet" type=3D"text/css"><!--<![endif]--><style> | |
| *{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{c= | |
| olor:inherit!important;text-decoration:inherit!important}#MessageViewBody a= |
This file contains hidden or 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
| test("3, 2", () => { | |
| expect(getPaging(3, 2)).toEqual(["1", "2", "3"]); | |
| }); | |
| test("4, 2", () => { | |
| expect(getPaging(4, 2)).toEqual(["1", "2", "3", "4"]); | |
| }); | |
| test("7, 2", () => { | |
| expect(getPaging(7, 2)).toEqual(["1", "2", "3", "...", "5", "6", "7"]); |
This file contains hidden or 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 from "react"; | |
| import { Field, FieldProps } from "formik"; | |
| import CKEditor from "@ckeditor/ckeditor5-react"; | |
| import ClassicEditor from "@ckeditor/ckeditor5-build-classic"; | |
| type CustomTextFieldProps = { | |
| options: any[]; | |
| name: string; | |
| label: string; | |
| editable: boolean; |
This file contains hidden or 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 getPagesSet = num => [num - 1, num, num + 1]; | |
| const calculatePagesPairs = (firstPart, lastPart) => { | |
| const intersectionIndex = firstPart.indexOf(lastPart[0]); | |
| if (intersectionIndex > -1) | |
| return [...firstPart.slice(0, intersectionIndex), ...lastPart]; | |
| const isNeighbors = lastPart[0] - firstPart[firstPart.length - 1] === 1; | |
| if (isNeighbors) return [...firstPart, ...lastPart]; |
This file contains hidden or 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
| for (let i = 0; i < 10; i++) { | |
| setTimeout(function() {console.log(i)}, 1000); | |
| } | |
| for (var i = 0; i < 10; i++) { | |
| (function (i) {setTimeout(function() { console.log(i) }, 1000)})(i) | |
| } | |
| for (var i = 0; i < 10; i++) { | |
| setTimeout('console.log('+ i +')', 1000); |