# babel-plugin-s2s-action-creator-ts

> generate action creator

Latest version **1.2.0** (published 2017-12-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-s2s-action-creator-ts
pnpm add babel-plugin-s2s-action-creator-ts
yarn add babel-plugin-s2s-action-creator-ts
bun add babel-plugin-s2s-action-creator-ts
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2017-12-15 |
| First published | 2017-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | kamijin_fanta |
| Maintainers | kamijin_fanta |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-s2s-action-creator-ts
- Repository: https://github.com/kamijin-fanta/babel-plugins
- npm.io page: https://npm.io/package/babel-plugin-s2s-action-creator-ts

## Dependencies (3)

- [@babel/types](https://npm.io/package/@babel/types.md) ^7.0.0-beta.35
- [lodash.camelcase](https://npm.io/package/lodash.camelcase.md) ^4.3.0
- [@babel/plugin-syntax-typescript](https://npm.io/package/@babel/plugin-syntax-typescript.md) ^7.0.0-beta.35

## Recent versions

- 1.2.0 (latest) — 2017-12-15
- 1.1.0 — 2017-12-15
- 1.0.0 — 2017-12-15

## README

# babel-plugin-s2s-action-creator-ts

plugin for https://github.com/akameco/s2s


## Install

```
$ npm install --save-dev babel-plugin-s2s-action-creator-ts
```


## Example


### Basic

#### IN:

```typescript
import External from 'external';
export type Action = Hoge | Fuga;

export interface Hoge {
  type: Actions.Hoge;
  key: number;
  data: External;
}
export interface Fuga {
  type: Actions.Fuga;
}

/***** Do not edit below this line *****/
export const enum Actions {
  Hoge = 'containers/Hoge',
  Fuga = 'containers/Fuga',
}
```

#### OUT:

```typescript
/***** Do not edit this file *****/
import External from 'external';
import { Actions, Hoge, Fuga } from "./actionTypes";
export function hoge(key: number, data: External): Hoge {
  return {
    type: Actions.Hoge,
    key,
    data
  };
}
export function fuga(): Fuga {
  return {
    type: Actions.Fuga
  };
}
```

## Usage

```
module.exports = {
  watch: './**/*.ts',
  plugins: [
    {
      test: /actionTypes.ts$/,
      output: 'actions.ts',
      plugin: 's2s-action-creator-ts',
    },
  ],
}
```

---
_Source: https://npm.io/package/babel-plugin-s2s-action-creator-ts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
