# @uxland/react-services

> Browser Utilities

Latest version **1.0.6** (published 2023-11-03) · BSD-4-Clause license · 0 weekly downloads

## Install

```sh
npm install @uxland/react-services
pnpm add @uxland/react-services
yarn add @uxland/react-services
bun add @uxland/react-services
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2023-11-03 |
| First published | 2023-01-13 |
| Weekly downloads | 0 |
| License | BSD-4-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 27.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alex Vizcaino |
| Maintainers | avizcaino, uxland-admin |

## Links

- npm: https://www.npmjs.com/package/@uxland/react-services
- Repository: https://github.com/uxland/uxland
- Homepage: https://github.com/uxland/uxland/tree/master/packages/browser-utilities#readme
- Issues: https://github.com/uxland/uxland/issues
- npm.io page: https://npm.io/package/@uxland/react-services

## Dependencies (8)

- [react](https://npm.io/package/react.md) ^18.2.0
- [i18next](https://npm.io/package/i18next.md) ^22.4.9
- [inversify](https://npm.io/package/inversify.md) ^6.0.1
- [@uxland/ioc](https://npm.io/package/@uxland/ioc.md) ^1.0.4
- [react-i18next](https://npm.io/package/react-i18next.md) ^12.1.4
- [react-toastify](https://npm.io/package/react-toastify.md) ^9.1.1
- [react-hooks-outside](https://npm.io/package/react-hooks-outside.md) ^1.0.3
- [i18next-browser-languagedetector](https://npm.io/package/i18next-browser-languagedetector.md) ^7.0.1

## Recent versions

- 1.0.6 (latest) — 2023-11-03
- 1.0.0-alpha.4 (alpha) — 2023-01-23
- 1.0.5 — 2023-10-23
- 1.0.4 — 2023-10-23
- 1.0.3 — 2023-03-24
- 1.0.2 — 2023-01-26
- 1.0.1 — 2023-01-26
- 1.0.0 — 2023-01-23
- 1.0.0-alpha.3 — 2023-01-16
- 1.0.0-alpha.2 — 2023-01-13
- 1.0.0-alpha.1 — 2023-01-13

## README

# UXL React Services [![npm version](https://badge.fury.io/js/%40uxland%2Freact-services.svg)](https://badge.fury.io/js/%40uxland%2Freact-services)

| Build Status                                    | Statements                                    | Branches                                  | Functions                                   | Lines                               |
| ----------------------------------------------- | --------------------------------------------- | ----------------------------------------- | ------------------------------------------- | ----------------------------------- |
| ![BuildStatus](#buildstatus# "Building Status") | ![Statements](#statements# "Make me better!") | ![Branches](#branches# "Make me better!") | ![Functions](#functions# "Make me better!") | ![Lines](#lines# "Make me better!") |

## Installation

`npm i @uxland/react-services`

## Usage

### Get Hook

```
getHook('hookName', {foo: 'bar'});
```

### Notification Service

```
const service = new NotificationService();
service.notify('foo', {position: 'bottom-right'});
service.notifyError('foo', {position: 'bottom-right'});
```

### I18N

#### Setup i18n

```
setupI18n({foo: 'bar'}, 'es', '-');
```

#### Translation Service

```
const service = new TranslationService();
service.translate('foo');
```

#### Add locale bundle

```
addLocaleBundle("ca", "ns", {foo: {bar: "dummy"}});
```

#### Global path hook

```
const globalPath = useGlobalPath();
globalPath("ns.foo.bar") // => dummy
```

#### Locale path hook

```
const localePath = useLocalePath("ns");
localePath("foo.bar") // => dummy
```

#### Translate

```
translate('ns', 'foo.bar', {dummy: 0})
```

---
_Source: https://npm.io/package/@uxland/react-services · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
