0.0.2 • Published 3 years ago

@flourish/font-watcher v0.0.2

Weekly downloads
7
License
UNLICENSED
Repository
-
Last release
3 years ago

Flourish font watcher

The function exported from this module will call window.template.update() (or another function) when any new fonts are loaded.

How to install

npm install -s @flourish/font-watcher

Then import it with:

import addFontWatcher from "@flourish/font-watcher";

Usage

If no callback is specified, then addFontWatcher will call window.template.update() whenever it detects that a new font has been loaded:

addFontWatcher();

If you supply a callback, then it will be called with a FontFaceSetLoadEvent object as the parameter. For example, you can do:

addFontWatcher(function () {
    console.log("Fonts have loaded");
});
0.0.2

3 years ago

0.0.1

4 years ago