How to use the decoders.dispatch function in decoders

To help you get started, we’ve selected a few decoders examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github purecloudlabs / iframe-coordinator / src / messages / HostToClient.ts View on Github external
export function validate(msg: any): HostToClient {
  return guard(
    dispatch('msgType', { publish: publicationDecoder, env_init: envDecoder })
  )(msg);
}
github purecloudlabs / iframe-coordinator / src / messages / ClientToHost.ts View on Github external
export function validate(msg: any): ClientToHost {
  return guard(
    dispatch('msgType', {
      publish: publicationDecoder,
      registeredKeyFired: keyDownDecoder,
      client_started: startedDecoder,
      navRequest: navRequestDecoder,
      toastRequest: toastDecoder
    })
  )(msg);
}