API Reference

Hactar has a very minimal API by design

CLI Options

plugins, -p

Plugins to install using npm. Any plugins passed to it are added to devDependencies in package.json. You can install plugins the exact same way using npm:

$ npm install --save-dev hactar-plugin-name

Plugins

function* saga(action, channel, getState)

A saga is a generator function that gets Flux actions, a channel, and state (set by other plugins)

Arguments

  1. action: A Flux standard action with a type and payload keys. For example:
{type: 'ADD_FILE', payload; { filepath: '~/project/src/index.js'}}
  1. channel: A js-csp channel. See the js-csp docs for the shape of its API

  2. getState: A redux getState function. Returns the current state of Hactar that plugins have added to. See the Redux docs for how its API

Returns

(Nothing): Sagas should only dispatch actions or yield.

function reducer(state, action)

A reducer function. They are the same as Redux reducers, so read its docs