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
180
何のためにドキュメントを書くのか
gajilabo_tsuji
0
98
PixiJS x Spineでキャラクターアニメーションを作ってみる
gajilabo_tsuji
1
480
Featured
See All Featured
Abbi's Birthday
coloredviolet
4
10k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Prompt Engineering for Job Search
mfonobong
0
520
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
The Cult of Friendly URLs
andyhume
79
7k
Agile that works and the tools we love
rasmusluckow
331
22k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
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デザイン / 情報設計
チーム / プロセス⽀援