SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Missing a reconnect
  2.  
  3.   const countdown = Machine({
  4.     id: 'count_down',
  5.     initial: 'idle',
  6.     states: {
  7.       idle: {
  8.         on: {
  9.           START: 'running'
  10.         }
  11.       },
  12.       running: {
  13.         initial: 'waiting',
  14.         states: {
  15.           'waiting': {
  16.             after: {
  17.               5000: { target: '#timeout' }
  18.             },
  19.             on: {
  20.               RESET: {
  21.                 internal: false,
  22.                 target: 'waiting'
  23.               }
  24.             }
  25.           }
  26.         },
  27.         on: {
  28.           DISCONNECT: 'idle'
  29.         }
  30.       },
  31.       timeout: {
  32.         id: 'timeout',
  33.         on: {
  34.           CLEAR: 'idle'
  35.         }
  36.       }
  37.     }
  38.   });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top