@yr/data-store-locales

3.2.0 • Public • Published

NPM Version Build Status

An @yr/data-store factory for managing locales.

init(localeCodes: Array)

Configure with valid locale codes.

add(localeCode: String, [data: Object], [options: Object]): DataStore

Add new locale for localeCode.

load(...args)

Load locale files.

For server environments, the signature is load(localespath: String), where localespath is a path to a directory of *.json files.

For browser environments, the signature is load(data: Object), where data is locale data for one locale.

freeze(data: Object)

Lock all locales after optionally setting data.

get(localeCode: String): DataStore

Retrieve locale DataStore for localeCode.

all(): Object

Retrieve all locale DataStores keyed by localeCode.

destroy()

Destroy all instances.

Readme

Keywords

none

Package Sidebar

Install

npm i @yr/data-store-locales

Weekly Downloads

7

Version

3.2.0

License

MIT

Unpacked Size

13.1 kB

Total Files

11

Last publish

Collaborators

  • yr
  • saegrov