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

@teambit/lanes.hooks.use-lane-readme

Package Overview
Dependencies
Maintainers
16
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@teambit/lanes.hooks.use-lane-readme

  • 0.0.221
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-80%
Maintainers
16
Weekly downloads
 
Created
Source

import { useDataQuery, DataQueryResult } from '@teambit/ui-foundation.ui.hooks.use-data-query'; import { gql } from '@apollo/client'; import { LanesQuery } from '@teambit/lanes.ui.models.lanes-model'; import { componentFields, ComponentModel } from '@teambit/component'; import { LaneId } from '@teambit/lane-id';

const GET_LANE_README_COMPONENT = gql query LaneReadmeComponent( $ids: [String!] $extensionId: String $logType: String $logOffset: Int $logLimit: Int $logHead: String $logSort: String ) { lanes { id list(ids: $ids) { id { name scope } hash readmeComponent { ...componentFields } } } getHost(id: $extensionId) { id } } ${componentFields};

export function useLaneReadme( laneId: LaneId, skip?: boolean ): { component: ComponentModel; } & Omit<DataQueryResult<LanesQuery, { ids: string[] }>, 'data'> { const { data, ...rest } = useDataQuery(GET_LANE_README_COMPONENT, { variables: { ids: [laneId.name] }, skip, });

const readmeComponentFromQuery = data?.lanes.list[0]?.readmeComponent;

const component = readmeComponentFromQuery && ComponentModel.from({ ...readmeComponentFromQuery, host: data.getHost.id });

return { ...rest, component, }; }

Keywords

FAQs

Package last updated on 17 Aug 2023

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc