Example #1
0
  function update(msg, state) {
    assert.equal(msg, 'first', 'Message incorrect');
    assert.equal(state.count, 0, 'Initial state incorrect');

    switch(msg) {
      case 'first':
        count ++;
        const newState = initState(state.count + 1);
        return [newState, Never()];

      default:
        return [state, Never()];
    }
  }
Example #2
0
 function init() {
   return [initState(0), Never()];
 }