How to use hearthstonejson-client - 2 common examples

To help you get started, we’ve selected a few hearthstonejson-client 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 HearthSim / Joust / ts / Launcher.tsx View on Github external
protected fetchLocale(cb?: () => void): void {
		const build = this._build || "latest";

		if (!this.hsjson) {
			this.hsjson = new HearthstoneJSON();
		}

		const queryTime = Date.now();
		this.hsjson.get(build, this.opts.locale).then((cards: any[]) => {
			// defer setCards if component isn't mounted yet
			if (this.ref) {
				this.ref.setCards(cards);
			} else {
				this.cards = cards;
			}
			this.track(
				"metadata",
				{ duration: (Date.now() - queryTime) / 1000 },
				{
					cards: cards.length,
					build,
github HearthSim / Joust / ts / components / DebugApplication.tsx View on Github external
protected loadLocale(locale: string, cb?: () => void) {
		if (!this.hsjson) {
			this.hsjson = new HearthstoneJSON();
		}
		this.setState({
			locale,
		});
		this.hsjson.getLatest(locale).then((cards: CardData[]) => {
			this.setState({
				cards,
			});
			cb && cb();
		});
	}

hearthstonejson-client

HearthstoneJSON client for browsers and Node

ISC
Latest version published 17 days ago

Package Health Score

63 / 100
Full package analysis

Popular hearthstonejson-client functions