Domma Reference
Complete API cheat sheet for rapid development

Global Aliases

Quick access to all Domma functionality via global shortcuts

Core Aliases

$Domma()
_Domma.utils
MDomma.models
DDomma.dates()
SDomma.storage

DOM Manipulation

90+ jQuery-compatible methods for selecting, traversing, and manipulating DOM elements

Selectors

$('.class'), $('#id'), $('tag')
$(element), $('<div>new</div>')
$(selector) Select elements
$(selector, context) Select within context
$(element) Wrap element
$(html) Create elements

Traversal (22)

$('.item').parent().addClass('active')
find(selector) Find descendants
parent(), parents() Navigate up
children() Direct children
siblings() Siblings
next(), prev() Adjacent
first(), last(), eq() Position
filter(), not(), is() Filter

Content

$('#output').html('<b>Bold</b>')
html() Get/set HTML
text() Get/set text
val() Get/set value

Attributes

$('img').attr('src', 'image.jpg')
attr(), removeAttr() Attributes
prop(), removeProp() Properties
data(), removeData() Data attributes

CSS & Classes

$('.box').addClass('active').css('color', 'red')
addClass() Add classes
removeClass() Remove classes
toggleClass() Toggle classes
hasClass() Check class
css() Get/set styles

Events (22+)

$('.btn').on('click', handler)
$('.list').on('click', '.item', handler)
on(event, handler) Bind event
on(event, selector, handler) Delegate
off(), one() Remove, once
trigger() Fire event
click(), focus(), etc. Shortcuts

Utilities (_)

120+ Lodash-compatible utility functions for data manipulation

Array Methods

_.map([1,2,3], x => x * 2)
_.filter(users, u => u.active)
map, filter, reduce Transform
forEach, each Iterate
find, findIndex Search
sortBy, orderBy Sort
chunk, partition Split

Object Methods

_.pick(obj, ['name', 'age'])
_.groupBy(users, 'role')
keys, values, entries Access
pick, omit Select fields
merge, assign Combine
groupBy, countBy Group

String Methods

_.camelCase('hello world')
_.template('Hello {{name}}')(data)
camelCase, kebabCase Case
capitalize, upperFirst Format
template Templates
escape, unescape Safety

Function Methods

_.debounce(fn, 300)
_.throttle(fn, 100)
debounce Delay execution
throttle Limit frequency
once Execute once
memoize Cache results

Models (M)

Reactive data models with validation, computed properties, and pub/sub

Model Creation

const user = M.create({
name: 'John',
age: 30
})
M.create(data) Create model
M.extend(proto) Prototype
model.get(key) Get value
model.set(key, value) Set value

Reactivity

model.on('change:name', handler)
M.publish('topic', data)
model.on(event, handler) Listen changes
M.publish(topic, data) Publish
M.subscribe(topic, handler) Subscribe

Storage (S)

Enhanced localStorage wrapper with JSON support and fallbacks

Storage Operations

S.set('user', {name: 'John'})
const user = S.get('user')
S.set(key, value) Store data
S.get(key, default) Retrieve data
S.remove(key) Delete item
S.clear() Clear all
S.keys() List keys

UI Elements

19 pre-built UI components with consistent API

Core Elements

Domma.elements.modal('#my-modal')
Domma.elements.alert('Hello!')
modal, dialog Overlays
toast, alert Messages
tabs, accordion Containers
dropdown, tooltip Overlays
carousel, timeline Content

Quick Actions

Copy these common patterns for rapid development

Common Patterns

AJAX Form Submit
Dynamic List
Event Delegation
Modal Confirmation