Skip to main content

std-loading

Level: Atom | Entity: LoadableItem | Persistence: runtime

4 states, 5 events, 7 transitions

Live Preview

orbital LoadableItemOrbital {
entity LoadableItem [runtime] {
id : string
name : string
description : string
status : string
createdAt : string
loadingStatus : string
}
trait LoadableItemLoading -> LoadableItem [interaction] {
initial: idle
state idle {
INIT -> idle
(set @entity.loadingStatus idle)
(render-ui main { type: "center", children: [{ type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "play-circle", size: "lg" }, { type: "typography", content: "LoadableItem", variant: "h2" }] }, { type: "divider" }, { type: "typography", variant: "body", color: "muted", content: "Ready to load loadableitem. Click Start to begin." }, { type: "button", label: "Start", event: "START", variant: "primary", icon: "play" }] }] })
START -> loading
(set @entity.loadingStatus loading)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "loading-state", title: "Loading", message: "Loading loadableitem..." }, { type: "spinner", size: "lg" }, { type: "progress-bar", value: 50, showPercentage: true }, { type: "skeleton", variant: "text" }] })
}
state loading {
LOADED -> success
(set @entity.loadingStatus success)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "md", align: "center", children: [{ type: "icon", name: "check-circle", size: "lg" }, { type: "typography", content: "Success", variant: "h2" }] }, { type: "divider" }, { type: "alert", variant: "success", message: "Operation completed successfully." }, { type: "button", label: "Reset", event: "RESET", variant: "ghost", icon: "rotate-ccw" }] })
FAILED -> error
(set @entity.loadingStatus error)
(render-ui main { type: "error-boundary", children: [{ type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "error-state", title: "Error", message: "Something went wrong. Please try again.", onRetry: "START" }, { type: "stack", direction: "horizontal", gap: "sm", justify: "center", children: [{ type: "button", label: "Retry", event: "START", variant: "primary", icon: "rotate-ccw" }, { type: "button", label: "Reset", event: "RESET", variant: "ghost" }] }] }] })
}
state success {
RESET -> idle
(set @entity.loadingStatus idle)
(render-ui main { type: "center", children: [{ type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "play-circle", size: "lg" }, { type: "typography", content: "LoadableItem", variant: "h2" }] }, { type: "divider" }, { type: "typography", variant: "body", color: "muted", content: "Ready to load loadableitem. Click Start to begin." }, { type: "button", label: "Start", event: "START", variant: "primary", icon: "play" }] }] })
}
state error {
START -> loading
(set @entity.loadingStatus loading)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "loading-state", title: "Loading", message: "Loading loadableitem..." }, { type: "spinner", size: "lg" }, { type: "progress-bar", value: 50, showPercentage: true }, { type: "skeleton", variant: "text" }] })
RESET -> idle
(set @entity.loadingStatus idle)
(render-ui main { type: "center", children: [{ type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "play-circle", size: "lg" }, { type: "typography", content: "LoadableItem", variant: "h2" }] }, { type: "divider" }, { type: "typography", variant: "body", color: "muted", content: "Ready to load loadableitem. Click Start to begin." }, { type: "button", label: "Start", event: "START", variant: "primary", icon: "play" }] }] })
}
}
page "/loadableitems/loading" -> LoadableItemLoading
}
Loading preview...

Orbital Visualization

Loading visualization...

Entity Fields

FieldTypeDefault
idstring-
namestring-
descriptionstring-
statusstring"active"
createdAtstring-
loadingStatusstring"idle"

States

StateType
idleInitial
loading-
success-
error-

Events

EventPayload
INIT-
START-
LOADED-
FAILED-
RESET-

Transitions

FromEventToEffects
idleINITidle2 effects
idleSTARTloading2 effects
loadingLOADEDsuccess2 effects
loadingFAILEDerror2 effects
errorSTARTloading2 effects
errorRESETidle2 effects
successRESETidle2 effects