Wanikani Open Framework Turbo Events

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

目前為 2024-07-28 提交的版本,檢視 最新版本

作者
Inserio
評價
0 0 0
版本
1.0.0
建立日期
2024-07-28
更新日期
2024-07-28
尺寸
11.1 KB
授權條款
MIT
腳本執行於

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}
);