Giter VIP home page Giter VIP logo

Comments (8)

DaRkLoL1 avatar DaRkLoL1 commented on July 28, 2024

Скриншот 22-04-2020 00_31_37
Можешь написать какой в этом смысл, почему нельзя навесить обработчик на сам элемент?

from o-slider.

DaRkLoL1 avatar DaRkLoL1 commented on July 28, 2024

Скриншот 22-04-2020 00_41_39
Здесь вроде лучше использовать спред-оператор в массиве [...collection]

from o-slider.

DaRkLoL1 avatar DaRkLoL1 commented on July 28, 2024

Скриншот 22-04-2020 00_49_15
Слушай а зачем ты используешь as HTMLELEMENT если может это сделать при создании переменной например let elem: HTMLELEMENT = this.element. Исправь везде

from o-slider.

DaRkLoL1 avatar DaRkLoL1 commented on July 28, 2024

Скриншот 22-04-2020 00_52_45
Этот метод все делает и ищет елементы и назначает обработчики и добавляет атрибуты.
Нужно придерживаться принципа разделения ответственности и single-responsibility: каждый метод должен делать что-то одно. Разделить поиск по dom и навешивание событий,

from o-slider.

DaRkLoL1 avatar DaRkLoL1 commented on July 28, 2024

Скриншот 25-04-2020 11_52_42
Ты не понял)) поиск и навешивание событий это должны быть 2 разных метода)

from o-slider.

DaRkLoL1 avatar DaRkLoL1 commented on July 28, 2024

Скриншот 25-04-2020 12_49_03 (1)
а для чего ты 2 раза присваиваешь значение?

from o-slider.

DaRkLoL1 avatar DaRkLoL1 commented on July 28, 2024

Скриншот 25-04-2020 22_44_28
зачем создавать этот элемент? для чего?

from o-slider.

DaRkLoL1 avatar DaRkLoL1 commented on July 28, 2024

Скриншот 28-04-2020 10_53_16
Скриншот 28-04-2020 10_53_43
Скриншот 28-04-2020 10_55_13
Поиск по DOM и добавление обработчиков нужно выносить в отдельные методы

from o-slider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.