Skip to content

Is it intended for waitFetch to be triggered when the location.hash changes? #276

Description

@SaidBySolo

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

// If we have a getData function registered for this route
if (!ctx.data && ctx.getData) {
try {
const { pathname, search } = location
// If not, fetch data from the JSON endpoint
ctx.data = waitFetch(`/-/data${pathname}${search}`)
} catch (status) {
// If it's an actual error...
if (status instanceof Error) {
ctx.error = status
}
// If it's just a promise (suspended state)
throw status
}
}

I was able to confirm that a request was made to '/-/data/path' whenever window.hash changed.

I thought that the request would not be made because hash is not a route change.

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