You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@blitzjs/core

Package Overview
Dependencies
Maintainers
4
Versions
327
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blitzjs/core

Blitz.js core functionality


Version published
Weekly downloads
322
decreased by-56.13%
Maintainers
4
Created
Weekly downloads
 

Readme

Source

core

This package contains the application-facing offerings of BlitzJS.

Some of the fullstack features that are available include:

  • Authentication Utilities
  • React Hooks
  • Session Management
  • Wrappers for the data-layer communications (RPC)

Usage

Fetch data from a query

import {useQuery} from "blitz"
import getUsers from "app/users/queries/getUsers"

const Users = () => {
  const [users] = useQuery(getUsers, {})

  return <pre style={{maxWidth: "30rem"}}>{JSON.stringify(users, null, 2)}</pre>
}

Session Context

import {Ctx} from "blitz"

export default async function trackView(_ = null, {session}: Ctx) {
  const currentViews = session.publicData.views || 0
  await session.setPublicData({views: currentViews + 1})
  await session.setPrivateData({views: currentViews + 1})

  return
}

FAQs

Package last updated on 13 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc