Esempio n. 1
0
function Form () {
  return State({
    user: Value({}),
    errors: Value({}),
    channels: {
      submit: submit
    }
  })
}
Esempio n. 2
0
function Click () {
  return State({
    greeting: Value('hello'),
    channels: {
      click: click
    }
  })
}
Esempio n. 3
0
function Input () {
  return State({
    message: Value('Type a message and hit enter'),
    channels: {
      submit: submit
    }
  })
}
Esempio n. 4
0
function Input () {
  return State({
    message: Value('Your message here'),
    channels: {
      submit: submit,
      input: input
    }
  })
}
function ApplicationRouter () {
  var state = Struct({
    router: Router(),
    route: Value('404'),
    states: Varhash()
  });

  Router.onNotFound(state.router, function () {
    state.router.active.set(null);
  });

  return state;
}