Skip to the content

Jarajaraジャラジャラ

Draw mahjong tiles, arrange racks and stacked boards, and play seeded Awase alone or at a shared table.

Jarajara is the Japanese sound of mahjong tiles rattling together. About the name

Contents

Reference · Tile and table elements

followLanguagefunction

Redraw an element when the page changes its language (<html lang>), as a language chooser does, until the function returned is called. One watcher serves every element on the page.

Import it

import { followLanguage } from "@johnmorrisdotca/jarajara/element";

Definition

function followLanguage(redraw: () => void): () => void

Parameters

NameTypeDescription
redraw() => void

The callback invoked when the page language changes.

Returns

() => void

Redraw an element when the page changes its language (<html lang>), as a language chooser does, until the function returned is called. One watcher serves every element on the page.

Examples

import { followLanguage } from "@johnmorrisdotca/jarajara/element";

const stop = followLanguage(()=>console.log("Language changed"));
stop();
console.log("Listener removed");
Listener removed

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/jarajara 1.7.0.