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