> For the complete documentation index, see [llms.txt](https://routeshub.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://routeshub.gitbook.io/docs/api/functions.md).

# Functions

## forwardParams

This function inserts parameters into the route state and outputs a ready-made dynamic state.

**Args:**

```typescript
/*
* Params interface describes an object which has string key
*/

(
  state: string[],
  params?: Params
)
```

**�Return Type:**

```typescript
string[]
```

**Usage example:**

```typescript
const url = forwardParams(userUnit.user.state, { id: 15 };
this.router.navigate(url);

// or

this.router.navigate(forwardParams(userUnit.user.state, { id: 15 })

```

## getRegisteredUnits

A function that returns all declared units in the application (hub)

**Generic Type:**

```typescript
<T = any>
```

**Args:**

```typescript
No args
```

�**Return Type:**

```typescript
Units<T>
```

**Usage example:**

```typescript
export interface Hub {
  app: AppNote & AppChildNotes;
  about: AboutNotes;
  bikes: BikeNotes
}

export const hub: Units<Hub> = getRegisteredUnits<Hub>();
```

## getUnit

A function that returns a unit by an identifier (key or name)

**Generic Type:**

```typescript
<R = any, C = {}>
```

**Args:**

```typescript
(
    arg: privateNotesKey
)
```

�**Return Type:**

```typescript
Unit<R, C>
```

**Usage example:**

```typescript
const unit = getUnit<AppNotes>(APP_HUB_KEY);
```

## connectFeatures

It connects feature-connector with parent routes.

**Generic Type:**

```typescript
<R = any, C = {}>
```

**Args:**

```typescript
(
   key: privateNotesKey,
   features: partialFeatureRoutes<R, C>
)
```

�**Return Type:**

```typescript
void
```

**Usage example:**

```typescript
createRoot<AppNotes, AppChildNotes>(appRoutes, { key: APP_NOTES_KEY });

/**
* it will connect aboutConnector to 'about' path of appRoutes
*/
connectFeatures<AppNotes, AppChildNotes>(APP_NOTES_KEY, {
  about: aboutConnector
});
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://routeshub.gitbook.io/docs/api/functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
