タグ

2017年4月19日のブックマーク (2件)

  • Litho

    DeclarativeLitho uses a declarative API to define UI components. You simply describe the layout for your UI based on a set of immutable inputs and the framework takes care of the rest. With code generation, Litho can perform optimisations for your UI under the hood, while keeping your code simple and easy to maintain. Asynchronous layoutLitho can measure and layout your UI ahead of time without bl

  • querySelectorAllしてmapしたいとき[...すると短い - hitode909の日記

    表示中のHTMLから情報を雑に抜き出して利用するため,ブラウザのデベロッパツールなどでquerySelectorAllしてmapしたい.しかし,querySelectorAllはNodeListを返すので,mapするにはArrayに変換する必要がある. NodeListをArrayに変換するときに短く書く方法ないですかって同僚に聞いたらいろいろ教えてもらえたのでメモ. Array.prototype.slice.callする オーソドックスな手法.昔からこれを書いていて,長くて困っていた.最近はアロー関数を使えるのでちょっと短くなったけど長い. Array.prototype.slice.call(document.querySelectorAll('a')).map(a => a.href) [].slice.callする Array.prototypeのかわりに[]で書く.ちょっと短い

    querySelectorAllしてmapしたいとき[...すると短い - hitode909の日記
    love0hate
    love0hate 2017/04/19
    $$!? しらなかった...