Skip to content

Extract fetch utilities to a separate package #6

@cristinecula

Description

@cristinecula

Problem

The fetch utilities in src/util/fetch/ duplicate functionality that exists in other Neovici packages (e.g., @neovici/core).

Current State

  • cosmoz-queue has its own fetch wrapper with setBaseInit, fetch, json, jsonPost, etc.
  • Similar utilities exist in other packages

Proposed Solution

Create a new public package (e.g., @neovici/fetch) containing:

  • setBaseInit with getHeaders callback support
  • fetch wrapper with header merging
  • handleJSON, json, jsonPost, jsonPut, jsonPatch, jsonDelete
  • RequestError class
  • URL utilities

Benefits

  • Single source of truth for fetch utilities
  • Reusable across all Neovici packages
  • Easier maintenance and consistent behavior

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