Skip to contents

Loads cached subjects data from local storage. If cache doesn't exist or reload is TRUE, fetches fresh data from the API and saves it to cache.

Usage

wk_load_subjects_cache(reload = FALSE, levels = NULL, types = NULL)

Arguments

reload

Logical indicating whether to reload data from API (default: FALSE)

levels

Optional numeric vector of levels to filter (applied after loading)

types

Optional character vector of types to filter ("radical", "kanji", "vocabulary")

Value

List containing subjects data from WaniKani API

Examples

if (FALSE) { # \dontrun{
# Load cached data (or fetch if no cache exists)
subjects <- wk_load_subjects_cache()

# Force reload from API
subjects <- wk_load_subjects_cache(reload = TRUE)

# Load specific levels only
subjects <- wk_load_subjects_cache(levels = 1:5)

# Load specific types only
subjects <- wk_load_subjects_cache(types = "kanji")
} # }