Learn how to integrate event listeners with components.
- [Instructor] Now, we'll create the listener…for our submit button.…We'll call this on-submit,…and this will need to take a frame.…First, I'm gonna use a let binding.…Then I'm gonna destructure on keys…and pull out the source, target, and copy keys…from the ui-data atom.…On the right hand side here,…I dereference the ui-data atom using the @.…Now, I'll check that source and target are non nil,…and inside of the when body,…I'll call the backend function arrange-images,…with the copy, source, and target arguments.…
We check that source and target here are non nil,…because the button still fires the submit event,…even when it's disabled.…With this listener implemented,…we're ready to add all of our listeners to the UI.…I'll call this function add-listeners.…Then we'll need to take the frame as an input.…Now, inside of a let,…I'm gonna call ss/group-by-id on the frame.…This will return a map, where the keys…correspond to the IDs of all of the widgets in our UI,…and the values are the widgets themselves.…
I'm gonna destructure this using keys…
Skill Level Intermediate
1. Problem 1: Exploring Lake Pend Oreille
2. Problem 2: Image Analysis
3. Problem 3: Eight Queens
4. Problem 4: Accessing Peripherals
5. Problem 5: Recursion and Directories
6. Problem 6: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.