@nteract/selectors

A colletion of state selectors

Usage no npm install needed!

<script type="module">
  import nteractSelectors from 'https://cdn.skypack.dev/@nteract/selectors';
</script>

README

@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