Wanikani Open Framework Turbo Events

Adds helpful methods for dealing with Turbo Events to WaniKani Open Framework

La data de 28-07-2024. Vezi ultima versiune.

Autor
Inserio
Rating-uri
0 0 0
Versiune
1.0.0
Creat
28-07-2024
Actualizat
28-07-2024
Size
11,1 KB
Licență
MIT
Se aplică pe

Library script that adds helpful methods for dealing with Turbo Events to WaniKani Open Framework that other userscripts can use to simplify their workflow.

All additions are added to a new turbo property of the wkof object, therefore accessible via wkof.turbo.

Example usage:

const onClickHandler = () => console.log('turbo:click event triggered');

wkof.turbo.on.click(onClickHandler);
function init() { console.log('init() has run'); }

wkof.turbo.on_page_event({
    urls: [/https:\/\/www\.wanikani\.com(\/dashboard.*)?\/?$/], 
    events: ['load', wkof.turbo.events.before_render], 
    callback: init}
);