WaniKani Custom SRS - WIP

It just assembles the paged results of each WK API endpoint into a single array (for each endpoint), and stores that directly in indexeddb. If you want to inject your data into WKOF, you could either capture (i.e. put a wrapper around) the WKOF Wk fetcher function, which is in wkof.ItemData.registry.sources.wk_items.fetcher(), or add your own data source, which would allow users to select those items separately.

If I recall correctly, the minimum requirement for adding a data source is:

wkof.ItemData.registry.sources['custom_srs'] =
{
   description: 'Custom SRS',
   fetcher: custom_srs_fetcher_function
}

And I think the fetcher function needs to return a promise that returns an item array formatted similar to WK’s /subjects endpoint, because other scripts will expect many of those item fields to be present.

6 Likes