Skip to content
Loamis build console Read only

copy

READ ONLY: generated from the specification

4 states, 5 events, 16 rules. Initial state: idle.

Transition graph

idlecopyingfailedcopied

Double outline: the initial state. Dashed line and ◆: the rule has a guard.

Transitions, as a list

  1. idle, on click, to copying, guarded: ctx.canCopy == true
  2. idle, on click, to failed, guarded: ctx.canCopy == false
  3. idle, on unavailable, to idle
  4. copying, on copyOk, to copied
  5. copying, on copyFailed, to failed
  6. copying, on unavailable, to failed
  7. copied, on tick, to copied, guarded: ctx.shownAt == 0
  8. copied, on tick, to idle, guarded: event.now > ctx.shownAt + ctx.resetAfter
  9. copied, on click, to copying, guarded: ctx.canCopy == true
  10. copied, on click, to failed, guarded: ctx.canCopy == false
  11. copied, on unavailable, to copied
  12. failed, on tick, to failed, guarded: ctx.shownAt == 0
  13. failed, on tick, to idle, guarded: event.now > ctx.shownAt + ctx.resetAfter
  14. failed, on click, to copying, guarded: ctx.canCopy == true
  15. failed, on click, to failed, guarded: ctx.canCopy == false
  16. failed, on unavailable, to failed

Live runner

Current state: idle

a whole number; the machine samples 1, 7

Context

resetAfter
0
shownAt
0
canCopy
true

View flags now

label
"copy"
ariaLive
"off"
disabled
false

Effects emitted

None.

Trace

No event sent yet.

States

idle

initial

View flags

label
"copy"
ariaLive
"off"
disabled
false

Rules that leave it

  1. click to copying when ctx.canCopy == true ; sets shownAt := 0 ; emits writeClipboard()
  2. click to failed when ctx.canCopy == false ; sets shownAt := 0
  3. unavailable to idle ; sets canCopy := false

copying

View flags

label
"copying"
ariaLive
"off"
disabled
true

Rules that leave it

  1. copyOk to copied ; sets shownAt := 0 ; emits announce("copied")
  2. copyFailed to failed ; sets shownAt := 0 ; emits announce("copyFailed")
  3. unavailable to failed ; sets shownAt := 0, canCopy := false ; emits announce("copyFailed")

copied

View flags

label
"copied"
ariaLive
"polite"
disabled
false

Rules that leave it

  1. tick to copied when ctx.shownAt == 0 ; sets shownAt := event.now
  2. tick to idle when event.now > ctx.shownAt + ctx.resetAfter ; sets shownAt := 0
  3. click to copying when ctx.canCopy == true ; sets shownAt := 0 ; emits writeClipboard()
  4. click to failed when ctx.canCopy == false ; sets shownAt := 0
  5. unavailable to copied ; sets canCopy := false

failed

View flags

label
"copyFailed"
ariaLive
"assertive"
disabled
false

Rules that leave it

  1. tick to failed when ctx.shownAt == 0 ; sets shownAt := event.now
  2. tick to idle when event.now > ctx.shownAt + ctx.resetAfter ; sets shownAt := 0
  3. click to copying when ctx.canCopy == true ; sets shownAt := 0 ; emits writeClipboard()
  4. click to failed when ctx.canCopy == false ; sets shownAt := 0
  5. unavailable to failed ; sets canCopy := false
All machines