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

@automattic/data-stores

Package Overview
Dependencies
Maintainers
25
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automattic/data-stores

Calypso Data Stores

  • 1.0.0-alpha.0
  • next
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-60.32%
Maintainers
25
Weekly downloads
 
Created
Source

Calypso Data Stores

This package contains a collection of @wordpress/data-based stores that can be used to fetch data from various WordPress.com REST API endpoints.

It is meant to be helpful for projects developed inside the Calypso monorepo that don't want to use Calypso's (monolithic) Redux state tree.

To use stores from the package, import and register the relevant store to obtain its key:

import React from 'react';
import { useSelect } from '@wordpress/data';
import { Verticals } from '@automattic/data-stores';

const VERTICALS_STORE = Verticals.register()

const VerticalSelect = () => ( {
	const verticals = useSelect( select =>
		select( VERTICALS_STORE ).getVerticals()
    );

    return (
        <ul>
            { verticals.map( vertical => (
                    <li key={ vertical.vertical_id }>{ vertical.vertical_name }</li>
            ) ) }
        </ul>
    );
} );

The stores in this package are written in TypeScript, and type definitions are generated as part of the build process. Furthermore, we're injecting type information for available selectors and actions into the @wordpress/data module, which means that you'll get handy autocomplete suggestions, if you're writing your project in TypeScript and you've enabled your editor's TypeScript feature or plugin.

autocomplete

FAQs

Package last updated on 03 Feb 2020

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