todo's People
todo's Issues
todoリストの要素にid属性を追加し、uuidを設定
id属性をtodoリストに追加する。
なぜなら、delete_todo
で要素を指定して削除するのに必要だったからだ。
TODOリストが0件の場合は画面に「TODOリストがありません」という文字列を表示させる
doneAreaでdoneボタンを押したらtodoAreaに戻るようにする
検討中の機能
repo間違えました
縦にスライドした際に、コンテンツが中途半端な位置になる。
そうなったときに自動で次のコンテンツに移動する処理
done_todo関数を実装する
Jestで単体テストをする
isDone
関数でStatusEnum.DONE
をStatusEnum.Done
と書いていて、予想と違う挙動になった。(580ff33)
防止するために、unit-test
リポジトリを作成してテストを書く。
delete_todo関数を実装する
createTodo関数へのJSDoc追加とデフォルト引数の追加
やること
JSDocをすべての変数に書く
TODO
- nullをオプションで渡す可能性があるコードにデフォルト引数を追加
[add] deleteTodo function #9
引数でnullとか渡すのが面倒だったりするので
デフォルト引数にしちゃえば明示的に渡さなくて済みます ( innerText = null )。
(直さないで大丈夫、知っておいてもらえれば)
if (!tag) {
return ;
}
const element = document.createElement(tag);
if (className) {
element.className = className;
}
if (innerText) {
element.textContent = innerText;
}
return element;
}
-
createTodo()
とcreateElementWrapper
の変数にjsdocを追加- [] オブジェクトの型指定が適当なところがあったので、オブジェクトの型名を明示する。
/** @type {HTMLDivElement | null} */
-
todosの型注釈(はんぞーさんに聞く)
/**
* todos has todo's content and status value
* @typedef {Object} Todo - todo object
* @property {string} id - Todo id (uuid). It is used when change indivisual todo item.
* @property {string} content - The description of the todo item.
* @property {StatusEnum} status - todo status that defines statusEnum.
**/
- nullを返す可能性がある関数にオプショナルチェーンをつける
-
submitButton
で、querySelectorはnull
を返す可能性もあるので、オプショナルチェーンをつける
document.querySelector(".submitButton").addEventListener("click", createTodo);
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.