Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Hello Workflow

rjrjr
June 20, 2019

Hello Workflow

rjrjr

June 20, 2019
Tweet

More Decks by rjrjr

Other Decks in Technology

Transcript

  1. class ChargeScreen { fun onCardSwiped(card: Card) { doStuffWithCard(card) if (tippingEnabled)

    goTo(TipScreen) else if (signatureRequired) goTo(SignatureScreen) else if (!skipReceipts) goTo(ReceiptScreen) else popTo(CartScreen) } } class TipScreen { fun onTip(tip: Money) { doStuffWithTip(tip) if (signatureRequired) goTo(SignatureScreen) else if (!skipReceipts) goTo(ReceiptScreen) else popTo(CartScreen) } }
  2. class ChargeScreen { fun onCardSwiped(card: Card) { doStuffWithCard(card) if (tippingEnabled)

    goTo(TipScreen) else if (signatureRequired) goTo(SignatureScreen) else if (!skipReceipts) goTo(ReceiptScreen) else popTo(CartScreen) } } class TipScreen { fun onTip(tip: Money) { doStuffWithTip(tip) if (signatureRequired) goTo(SignatureScreen) else if (!skipReceipts) goTo(ReceiptScreen) else popTo(CartScreen) } }
  3. class CheckoutWorkflow { } CartScreen ChargeScreen TipScreen SignatureScreen ReceiptScreen onCard

    / tipping onCard onTip onCard / skipSig onTip / skipSig onSig onSig / skipReceipt onReceipt
  4. class NewGameScreen( val onStart: (String, String) -> Unit ) class

    NewGameRunner( view: View ) : LayoutRunner<NewGameScreen> { val player1 = view.findById<TextView>() // etc. fun showRendering(r: NewGameScreen) { playButton.setOnClickHandler { r.onStart(player1.text, player2.text) } } } LayoutRunner Workflow Rendering
  5. class NewGameScreen( val onStart: (String, String) -> Unit ) class

    NewGameRunner( view: View ) : LayoutRunner<NewGameScreen> { val player1 = view.findById<TextView>() // etc. fun showRendering(r: NewGameScreen) { playButton.setOnClickHandler { r.onStart(player1.text, player2.text) } } } LayoutRunner Workflow Rendering