ぜのぜ

しりとりしようぜのぜのぜのぜ

432日目

日記

BASE BREAD便利すぎてそればっかり食べているので食材がなくなった。これで幼稚園から一緒の幼馴染が急に遊びに来てありもので作るねというイベントのフラグが折れた*1

今日書いたコード

クラス名、ラベル、アイコンをまとめて管理した · Gurrium/pin-course-points@71eeccd · GitHub

感想

引数周りを雰囲気で理解していたが、完全に理解した。 Object.entries()はkeyとvalueの配列の配列を返すので[_, _]で受けられて、valueはDestructuring assignment*2でいい感じに変数に取り出せる。[_, _]で受けられるのもDestructuring assignmentか。

const pointTypes = {
    'Generic': {
        class: 'generic',
        label: 'Generic',
        icon: '⛳️',
    },
    // ...
}

Object.entries(pointTypes).forEach(([_, { class: classString, label: labelString, icon: icon }]) => {
    // ...
})

429日目

日記

今日書いたコード

大体動くようになった チェックが外れたPOIは表示しないようにした · Gurrium/pin-course-points@d4e91f3 · GitHub

感想

昨日言ってたやつ

In many cases, and where possible, it is best practice to dynamically manipulate classes via the className property since the ultimate appearance of all of the styling hooks can be controlled in a single stylesheet. Using dynamic styling information - Web APIs | MDN