import {Meta} from '@storybook/addon-docs/blocks'

<Meta title='@dxtmisha/en/functional-basic/! About the Library'/>

# [@dxtmisha/functional-basic](https://github.com/dxtmisha/dxt-ui/tree/main/packages/functional-basic)

`@dxtmisha/functional-basic` is a small utility library for everyday web development. It is framework-agnostic and can be used in any TypeScript project, including Vue, React, Nuxt, or plain browser code.

## Installation

To start using the library in your project, install it via npm:

```bash
npm i @dxtmisha/functional-basic
```

## Why this library?

Most web projects face similar tasks: API requests, handling dates, cookies, or loading states. Instead of copying these functions between projects, we gathered them here for easier reuse.

It is not a complex framework, but a simple collection of tools: you can pick only what you need for your specific task.

## What does it do?

The library covers common tasks encountered during development:

For **networking** — a basic HTTP client with hook support, caching, and loading indicators. This allows you to handle requests without adding heavy external dependencies.

For **localization and geography** — user country and language detection, phone codes, country flags, and data formatting via the `Intl` API. It also includes tools for interface translations.

For **state management** — simple wrappers for `localStorage`, `sessionStorage`, `cookie`, and URL hash. They help persist data across sessions with TypeScript support.

For **SEO** — tools to manage `<title>`, Open Graph, and Twitter Card. They help keep meta tags updated in both browser and SSR environments.

For **data manipulation** — utilities for deep object cloning, array processing, safe type conversion, and string formatting.

For **search and filtering** — functions for text matching and easy searching through complex data lists.

For **events and broadcasting** — tools for communication between components or browser tabs (via `BroadcastChannel`).

For **DOM and UI** — helper functions for working with elements, attributes, images, clipboard, and scrolling.

## Who is it for?

The library is for developers who prefer using common solutions for simple tasks instead of writing them from scratch each time. It works well for both small scripts and larger applications.

While it is part of the `@dxtmisha` ecosystem, it can be used independently in any project.

## Principles

- **Minimalist** — the library uses no external dependencies, making maintenance easier.
- **TypeScript Support** — all tools are typed to improve the developer experience.
- **Clear API** — method names and their behavior are designed to be predictable.
- **Tested** — core functions are covered by tests to ensure basic stability.

## Git

[https://github.com/dxtmisha/dxt-ui/tree/main/packages/functional-basic](https://github.com/dxtmisha/dxt-ui/tree/main/packages/functional-basic)
