Git Product home page Git Product logo

odin-todo's Introduction

Odin - ToDo

This project is provided by Odin.
Here I set out to reinforce the following skills:

  • Webpack Usage
  • Dynamic DOM Rendering
  • The SOLID Pattern

Challenges Overcome:

  • Rendering elements with event listeners:
    • Returning or exporting innerHTML removes all event listeners.
      I overcame this behavior by returning the node itself.
  • Form removal when licking outside the form:
    • Solved by adding a mousein and mouseout triggers and listening for a click on the parent container. (mouseout and mouseleave differ with that mouseout bubbles up while mouseleave doesn't. Same for mousein and mouseenter).
  • Form didn't disappear on first click:
    • You can fire the event by yourself with functions like element.click().
  • localStorage doesn't store object functions:
    • Upon object array retrieval, firstly JSON.parse, then map(task => new Task(...task));
  • Can't refresh only one part of the page upon change:
    • Export a function instead of a Node, this allows you to call the function, thereby re-assign all the variables in the component.
    • Change detection is done using MutationObserver
  • No id on refresh:
    • localStorage has an extra parameter of lastID stored, it is being dictated by the last Task created.
  • keydown and focusout events collision
    • When an enter key was pressed, the page reloaded. On page reload, the focusout event fired. the solution is rather simple. If an enter key is pressed, remove the focusout listener.

Credit

Hamburger menu icon

odin-todo's People

Contributors

haswell-s avatar

Watchers

 avatar

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.