@uxland/react-services
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

UXL React Services npm version

Build Status Statements Branches Functions Lines
BuildStatus Statements Branches Functions Lines

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})

Readme

Keywords

none

Package Sidebar

Install

npm i @uxland/react-services

Weekly Downloads

6

Version

1.0.6

License

BSD-4-Clause

Unpacked Size

28.5 kB

Total Files

18

Last publish

Collaborators

  • avizcaino
  • uxland-admin