April 24, 2024, 10:46 p.m. | Daishi Kato

DEV Community dev.to




Learn Jotai with handy tips!




Introduction


I've been sharing tips about Jotai on Twitter, calling them "Jotai tips." As tweets tend to get lost over time, I thought it would be good to have all these tips in one place.


So, here we go.





Tip 1: Primitive-like atoms





// Detect dark theme
var iframe = document.getElementById('tweet-1694494217379459573-419');
if (document.body.className.includes('dark-theme')) {
iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1694494217379459573&theme=dark"
}







Tip 2: Early return





// Detect dark theme
var iframe = document.getElementById('tweet-1694876971367555217-269');
if (document.body.className.includes('dark-theme')) {
iframe.src = …

document good introduction javascript jotai learn lost react them thought tips tweet tweets twitter

Founding AI Engineer, Agents

@ Occam AI | New York

AI Engineer Intern, Agents

@ Occam AI | US

AI Research Scientist

@ Vara | Berlin, Germany and Remote

Data Architect

@ University of Texas at Austin | Austin, TX

Data ETL Engineer

@ University of Texas at Austin | Austin, TX

Lead GNSS Data Scientist

@ Lurra Systems | Melbourne