@nteract/selectors
TypeScript icon, indicating that this package has built-in type declarations

3.2.0 • Public • Published

@nteract/selectors

This package provides a set of selectors and functions that allow you to extract important information from the state of your nteract application. To see a full set of the data stored in application state that be extracted with this package, you can view the AppState type.

Installation

$ yarn add @nteract/selectors
$ npm install --save @nteract/selectors

Usage

import { modalType, currentTheme } from "@nteract/selectors";

const state = {
  config: {
    theme: "dark"
  },
  core: {
    entities: {
      modals: {
        modalType: "ABOUT"
      }
    }
  }
};

const theme = currentTheme(state);
const currentModal = modalType(state);
console.log(`Rendering ${currentModal} modal using ${theme} theme.`);
> Rendering ABOUT modal using dark theme.

Documentation

You can view the reference documentation for @nteract/selectors in the package docs.

Support

If you experience an issue while using this package or have a feature request, please file an issue on the issue board and add the pkg:selectors label.

License

BSD-3-Clause

/@nteract/selectors/

    Package Sidebar

    Install

    npm i @nteract/selectors

    Weekly Downloads

    786

    Version

    3.2.0

    License

    BSD-3-Clause

    Unpacked Size

    827 kB

    Total Files

    49

    Last publish

    Collaborators

    • benabel
    • alexandercbooth
    • benrussert
    • mpacer
    • theengineear
    • yuvipanda
    • rgbkrk
    • lgeiger
    • ivanov
    • captainsafia
    • peggyrayzis
    • jdetle
    • hasch
    • willingc
    • stormpython
    • crystalline-cat
    • emeeks
    • hydrosquall