Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@defer/client

Package Overview
Dependencies
Maintainers
2
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@defer/client - npm Package Versions

1
17

1.8.0-alpha-20230714142647-7fcb7e0

Diff

wittydeveloper
published 1.8.0-alpha-20230714142523-4da9b44 •

wittydeveloper
published 1.8.0-alpha-20230714142133-7286e7b •

wittydeveloper
published 1.7.2 •

Changelog

Source

1.7.2

Patch Changes

wittydeveloper
published 1.7.2-alpha-20230712093216-474e34e •

wittydeveloper
published 1.7.2-alpha-20230712092803-8477826 •

wittydeveloper
published 1.7.1 •

Changelog

Source

1.7.1

Patch Changes

wittydeveloper
published 1.7.1-alpha-20230711085406-54ec6f7 •

wittydeveloper
published 1.7.0 •

Changelog

Source

1.7.0

Minor Changes

  • #66 b9973d5 Thanks @charlypoly! - Introducing @defer/client/next integration

    This release introduces two new helpers that makes Defer deeply integrated with NextJS:

    • asNextRoute(): used in combination of useDeferRoute() to trigger background functions from Client-side Components
    • useDeferRoute(): trigger and wait for the result of a background functions from Client-side Components

    Next API Routes

    import { asNextRoute } from "@defer/client/next";
    import createThumbnails from "../../defer/createThumbnails";
    
    const { GetHandler, PostHandler } = asNextRoute(createThumbnails);
    
    export const GET = GetHandler;
    export const POST = PostHandler;
    

    React client-side component

    import { useDeferRoute } from "@defer/client/next";
    import createThumbnails from "../../defer/createThumbnails";
    
    export function MyComp() {
      const { request, loading, result } = useDeferRoute(createThumbnails);
      return (
        <div>
          <span>Loading: {loading ? "Yes" : "No"}</span>
          <span>Result: {result ? JSON.stringify(result) : "--"}</span>
          <button onClick={() => request("")}>Call</button>
        </div>
      );
    }
    
wittydeveloper
published 1.7.0-alpha-20230711083627-6da5ab9 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc