Master Finance Tools - 35% Off CFI (Code CFI35)
Power BI Fundamentals - Create visualizations and dashboards from scratch
Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn how to transition from p5.js 1.0's preload() function and callback-based data loading to the new async/await pattern introduced in p5.js 2.0. Explore the fundamental differences between synchronous and asynchronous code execution, understand how JavaScript promises work, and discover how to implement async setup() functions for cleaner data loading workflows. Master the process of switching between p5.js versions in the web editor, compare callback-based loading methods with modern promise-based approaches, and learn techniques for sequencing multiple data loading operations. Practice creating custom asynchronous functions and implementing loading animations while data is being fetched. Work with practical examples using the Dog API to load external data, and gain hands-on experience with three interactive p5.js sketches demonstrating async/await implementation, loading animations, and sequential data loading patterns.
Syllabus
0:00:00 p5.js 2.0!
0:03:00 Switching versions in the web editor
0:05:02 Loading with p5.js 1
0:06:11 Synchronous vs Asynchronous Code
0:08:37 Promises!
0:11:29 switching from preload to async setup
0:13:57 Loading with callbacks in p5.js 1.0
0:17:15 Sequencing loading data in p5.js 1.0
0:19:26 Sequencing with async and await in p5.js 2.0
0:20:09 Creating a custom Async Function
0:22:13 Thank you for watching!
Taught by
The Coding Train