scrimba
Learn Imba
Event Modifiers
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Event Modifiers
AboutCommentsNotes
Event Modifiers
Expand for more info
index.imba
run
preview
console
import {nanoid} from 'nanoid'
import "./habit-group"
import "./habit-item"
import "./habit-adder"

tag dopamine-box
prop habits = [{name: "Clean Up", done: true, id: nanoid()}]

def completeAll
for habit in habits
habit.done = true

def resetAll
for habit in habits
habit.done = false

css self d:vflex g:10px
div.controls d:flex jc:space-between
button bgc:transparent td@hover:underline fs:xs color:blue5 cursor:pointer

<self>
<habit-group habits=habits>

<div.controls>
<button @click=completeAll> "Complete All"
<button @click=resetAll> "Reset All"

<habit-adder>


imba.mount <dopamine-box>
Console
/index.html
-6:19