Skip to content

Instantly share code, notes, and snippets.

@doridori
Last active January 5, 2022 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doridori/762d6b813a7395506922421913cc9023 to your computer and use it in GitHub Desktop.
Save doridori/762d6b813a7395506922421913cc9023 to your computer and use it in GitHub Desktop.
Runtime Centric Thinking Blog post snippts
val commandHandler: CommandHandler
var runtimeData: RuntimeData
fun RuntimeKernel.receive(action) {
//the runtime maintains its own main loop
marshallToRuntimeMainThread {
val transition = reduce(action, runtimeData)
runtimeData = transition.runtimeData
//effect system, describes commands and runtimeData state change operations
val transitionOperations = describe(transition)
perform(transitionOperations)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment