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

7.1.0 • Public • Published

@nteract/actions

This package contains definitions of constants and action creators that can be used to create Redux actions in your nteract application. These actions can be dispatch to create new cells, launch kernels, create new notebooks, execute cells, and much more. To see this package in action, you can view the source code for the @nteract/epics and @nteract/core packages.

Installation

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

Usage

The Redux reducer below shows how we can leverage the actions and action types in this package to create a reducer for managing the status of a save event.

import actions from "@nteract/actions";

export default function myReducer(
  state: MyState,
  action: actions.Save | actions.SaveFulfilled | actions.SaveFailed
) {
  switch (action.type) {
    case actions.SAVE:
      return { ...state, status: "saving" };
    case actions.SAVE_FULFILLED:
      return { ...state, status: "success" };
    case actions.SAVE_FAILED:
      return { ...state, status: "failed" };
    default:
      return state;
  }
}

Documentation

You can view the reference documentation for @nteract/actions 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:actions label.

License

BSD-3-Clause

Readme

Keywords

none

Package Sidebar

Install

npm i @nteract/actions

Weekly Downloads

970

Version

7.1.0

License

BSD-3-Clause

Unpacked Size

952 kB

Total Files

76

Last publish

Collaborators

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