Skip to content

Function passing not working? #67

Description

@harrislapiroff

I'm trying to do something sort of complicated on my site (basically work around #66) using the function passing capability, but it doesn't seem to be working for me. I simplified it down to a minimal form. I have this global data file cachetest.js:

import Fetch from "@11ty/eleventy-fetch"

export default async function() {
    return await Fetch(async () => {
        console.log("Cache miss")
        return {
            foo: "bar"
        }
    }, {
        requestId: "cachetest",
        duration: "1h"
    })
}

Each time I run it logs "Cache miss" to the shell output. Never does it seem to write anything to .cache. Have I done something wrong here?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions