Creating Notes

Let's create the notes and units.

import { createRoot, createNote, Root, Note } from 'routeshub';

/**
* describes children path
*/
export interface AppChildNotes extends Root {
  about: Note;
}

/**
* Root interface is the shortcut of ''(root) path
* Designed to speed up code reusing
*/
export interface AppNotes extends Root<AppChildNotes> {
  auth: Note;
  notFound: Note;
}

/**
  * it is equivalent of the code above
  * choose the one you comfortable with
  export interface AppNotes {
    root: Note<AppChildNotes>
    auth: Note;
    notFound: Note;
  }
*/

// unique key of app hub. It acts as a unique routes identifier
export const APP_NOTES_KEY = Symbol();

Last updated