WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

bug: onError in resource is getting called twice #67

@ssiyad

Description

@ssiyad

Sample code

createResource({
  url: "https://example.com",
  auto: true,
  validate() {
    return "Sample error";
  },
  onError(error) {
    alert(error);
  },
});

Expected

One alert with 'Sample error'

Result

Gets two alerts with 'Sample error'

Possible cause

handleError is getting called twice from here. The second call might be due to error thrown from handleError

Possible fix

Remove error thrown from handleError?

Metadata

Metadata

Assignees

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