Skip to content

Commit

Permalink
features(transform):
Browse files Browse the repository at this point in the history
Adds the transform API.
- Similar to 'middleware' but it transforms data on the fly without making a new request (happens instantly)
- 'transform' first checks data is not undefined before running, which makes sure it only runs when data or fallback data exist, preventing (most) runtime errors that could arise when manipulatind data that could be undefined
  • Loading branch information
danybeltran committed Dec 11, 2024
1 parent 3119808 commit dd54ec5
Show file tree
Hide file tree
Showing 6 changed files with 249 additions and 238 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "http-react",
"version": "3.7.3",
"version": "3.7.4",
"description": "React hooks for data fetching",
"main": "dist/index.js",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions src/components/server/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use client"
'use client'

import { FetchConfigAsync } from "../FetchConfigAsync"
import { FetchConfigAsync } from '../FetchConfigAsync'

import { FetchConfig as FConfig, SSRSuspense } from "../index"
import { FetchConfig as FConfig, SSRSuspense } from '../index'

const FetchConfig = typeof window === "undefined" ? FetchConfigAsync : FConfig
const FetchConfig = typeof window === 'undefined' ? FetchConfigAsync : FConfig

export { FetchConfig, SSRSuspense, FConfig as FetchConfigSync }
Loading

0 comments on commit dd54ec5

Please sign in to comment.