BemtvJS
Github
  • README
  • Getting started
  • Introducing Brackethtml
  • Creating components
  • Defining the template
  • Rendering
  • Styling the component
  • .css() methods
  • SuperComponent
  • Hooks
  • Handling events
  • Isolated and special variables
  • Component proxies
  • No “props”!
  • Functional components - onInst()
  • DOM Elements
  • Bindings
  • Transformation Functions
  • Router(automatic routing)
    • Capturing errors
    • useRouteControl()
  • Lazy components
  • Suspense
  • State management
  • Keeping the instance running
  • run() - For all
  • Checking available components
  • And that’s it
Powered by GitBook
On this page
  1. Router(automatic routing)

Capturing errors

Whenever the route is unknown, Bemtv will warn you through the onRouteUnfound() function which accepts a listener/callback as the first argument:

import { onRouteUnfound } from "bemtv";

onRouteUnfound(() => {
  console.log("We are on an unknown route :(");
});
PreviousRouter(automatic routing)NextuseRouteControl()

Last updated 2 years ago