Skip to content

Add support for predefined sequences of interaction. #2

@hayleigh-dot-dev

Description

@hayleigh-dot-dev

We have a way for users to set up state for their stories through the use of controls like fable.input and fable.checkbox. It would be powerful to let users also define hardcoded sequences of state updates, something like:

use username, set_username <- fable.input("Username")
use password, set_password <- fable.input("Password")
use loading, set_loading <- fable.checkbox("Submission in progress")
use error, set_error <- fable.input("Error message")

use <- fable.sequence("Login failed sequence", [
  fable.type("[email protected]", set_username),
  fable.type("strawberry"),
  set_loading(True),
  fable.wait(1000),
  set_loading(False),
  set_error("Account not found or password incorrect")
])

...

It's important to note this isn't sequencing messages or events, instead its sequencing state. The way our stories work, they are designed to be separate from update logic: we only care about how things look and what state to give them to make them look that way.

Metadata

Metadata

Labels

featureNew features or functionality.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions