Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
JavaScript の関数型ライブラリ Ramda.js を使ってみよう
Search
tsuji-108
November 16, 2023
280
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JavaScript の関数型ライブラリ Ramda.js を使ってみよう
tsuji-108
November 16, 2023
More Decks by tsuji-108
See All by tsuji-108
「ある文字列に日本語が含まれるか」をJavaScriptの正規表現で判定してみよう
gajilabo_tsuji
0
170
何のためにドキュメントを書くのか
gajilabo_tsuji
0
97
PixiJS x Spineでキャラクターアニメーションを作ってみる
gajilabo_tsuji
1
470
Featured
See All Featured
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
The untapped power of vector embeddings
frankvandijk
2
1.9k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
270
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
690
Skip the Path - Find Your Career Trail
mkilby
1
220
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
540
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
310
The Curse of the Amulet
leimatthew05
2
14k
Believing is Seeing
oripsolob
1
210
Transcript
JavaScript の関数型ライブラリ Ramda.js を使ってみよう tsuji-108 @ 株式会社Gaji-Labo 2023/11/15 第12回LT練習会
⾃⼰紹介 @tsuji-108 株式会社Gaji-Labo フロントエンドエンジニア
01. Ramda.js とは? 02. Ramda.js の便利な関数 アジェンダ
01 Ramda.js とは?
Ramda.js とは? Ramda.js とは、関数型プログラミングの考え⽅を取り⼊れたユーティリティライブラリです。 > 公式サイト: https://ramdajs.com/ JavaScript のユーティリティライブラリと⾔えば Lodash
( https://lodash.com/ )が有名です。 Ramda.js とは、いうなれば「関数型プログラミングを取り⼊れた Lodash」です。
02 Ramda.js の便利な関数
Ramda.js の便利な関数 Ramda.js には⾮常に便利な関数が揃っており、フロントエンド開発で強⼒な味⽅になります! • clone():引数に⼊れた要素のディープコピーを返却します。 ◦ https://ramdajs.com/docs/#clone • mergeAll()
:引数に⼊れた配列内のオブジェクトをすべてマージして返却します。 ◦ https://ramdajs.com/docs/#mergeAll • equals() :引数に⼊れた要素同⼠が⼀致するかを判定します。 ◦ https://ramdajs.com/docs/#equals • pick():第⼆引数のオブジェクトから、第⼀引数で指定したプロパティを抽出したオブジェクトを返却し ます。 ◦ https://ramdajs.com/docs/#pick
compose() ‧ pipe() compose() と pipe() は、いずれも引数の関数を合成して1つの関数にまとめます。 > compose(): https://ramdajs.com/docs/#compose
> pipe(): https://ramdajs.com/docs/#pipe
compose() ‧ pipe() composed() と pipe() の違いは、関数の実⾏順(合成順)にあります。 composed() は、引数の関数のうち、最後に⼊れた関数から順次実⾏します。 pipe()
は、引数の関数のうち、最初に⼊れた関数から順次実⾏します。
composed() ‧ pipe() で⼀括管理!
composed() ‧ pipe() で⼀括管理! composed() と pipe() は、複雑なプログラムを簡潔にまとめられます! 特に⻑〜い⼿続き的プログラムやコールバック地獄には効果テキメンです!
まとめ 以上、Ramda.js の紹介でした! Ramda.js を導⼊すれば、Webアプリ開発でよく利⽤する機能をすぐに導⼊できます。 その中でも composed() と pipe() は、Ramda.js
を代表する強⼒な機能で、複雑な処理をシンプルにまとめら れます。 今回のスライドで紹介した事以外にも「カリー化」などの便利な点が、まだまだ Ramda.js にはあります! もし機会があれば、Ramda.js に触れてみてはいかがでしょうか。 > 公式サイト: https://ramdajs.com/
会社紹介 すべてのサービスとプロダクトに 「⼿ざわりのいいUI」を 新規事業やサービス開発 ∕ プロダクト開発に取り組むチームのサポートが得意な会社です。 フロントエンド開発 UIデザイン / 情報設計
チーム / プロセス⽀援