How to use the ilib.setLoaderCallback function in ilib

To help you get started, we’ve selected a few ilib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enactjs / enact / packages / i18n / src / glue.js View on Github external
* Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an 'AS IS' BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import ilib from 'ilib';

import './dates';

import Loader from './Loader';
import {updateLocale} from '../locale';

ilib.setLoaderCallback(new Loader());

if (typeof window === 'object' && typeof window.UILocale !== 'undefined') {
	// this is a hack until GF-1581 is fixed
	ilib.setLocale(window.UILocale);
}

// we go ahead and run this once during loading of iLib settings are valid
// during the loads of later libraries.
updateLocale(null, true);