Fetch

No summary available

Import
the javascript logo
import { Fetch } from "@schukai/monster/source/i18n/providers/fetch.mjs";
Source
the git logo
Package
the npm logo
Since
1.13.0

Exported

Fetch

Derived from

Provider

Options

The Options listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Options from these parent classes. If you cannot find a specific Options in this list, we recommend consulting the documentation of the Provider.

Option
Type
Default
Description
object
fetch
string
fetch.method=GET
string
fetch.mode=cors
string
fetch.cache=no-cache
string
fetch.credentials=omit
string
fetch.redirect=follow
string
fetch.referrerPolicy=no-referrer

Properties

The Properties listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Properties from these parent classes. If you cannot find a specific Properties in this list, we recommend consulting the documentation of the Provider.

Methods

The methods listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits methods from these parent classes. If you cannot find a specific method in this list, we recommend consulting the documentation of the Provider.

Constructor

constructor(url,options)
Parameters
  • url {string|url}: url
  • options {object}: see {@link Monster.I18n.Providers.Fetch#defaults}
As options the key fetch can be passed. This config object is passed to the fetch method as init. The url may contain placeholders (language, script, region, variants, extlang, privateUse), so you can specify one url for all translations. ``new Fetch('https://www.example.com/assets/${language}.json')``

Structural methods

getTranslations(locale)
Parameters
  • locale {locale|string}: locale
Returns
  • {Promise}

Events

This component does not fire any public events. It may fire events that are inherited from its parent classes.

The current width of the area is too small to display the content correctly.