routeshub
  • Introduction
  • Installation
  • Example
    • Initial Code
    • Creating Notes
    • Creating Hub
    • Navigating
  • Concepts
    • Introduction
    • Notes
    • Units
  • API
    • Interfaces
    • Creators
    • Directives
    • Functions
    • Decorators
Powered by GitBook
On this page
  • createNote
  • createRoot
  • createFeature

Was this helpful?

  1. API

Creators

PreviousInterfacesNextDirectives

Last updated 5 years ago

Was this helpful?

Name

Type

Args

Return Type

<R = any, C = any>

routes, nameOptions

Notes<R, C>

<R = any, C = any>

routes, { key, nearby, routeName }

<R = any, C = any>

routes, { key, nearby, routeName }

Creates a route note unit. It uses internally by /

Generic Type:

<R = any, C = any>

Args:

(
  routes: Route[],
  nameOptions: DefaultNameOptions = {}
)

Return Type:

Notes<R, C>

Creates the root unit and invokes only once to initialize a hub.

Generic Type:

: <R = any, C = any>

Args:

(
  routes: Route[],
  { key, nearby, routeName }: Partial<CreatorOptionArgs> = {}
)

Return Type:

: Unit<R, C>

Usage example:

export const appUnit: Unit<AppNotes, AppChildNotes> = 
    createRoot<AppNotes, AppChildNotes>(routes, { key: KEY });

Invokes once for each feature (eager/lazy) module.

Generic Type:

: <R = any, C = any>

Args:

(
  routes: Route[],
  { key, nearby, routeName }: Partial<CreatorOptionArgs> = {}
)

Return Type:

: Connector<R, C>

Usage example:

export const aboutConnector: Unit<AboutNotes> = 
    createFeature<AboutNotes>(routes, { key: ABOUT_HUB_KEY});

<R & C>

<R & C>

createNote
createRoot
createFeature
createRoot
createFeature
createNote
createRoot
createFeature
Unit
Connector