Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Latest commit

 

History

History
60 lines (45 loc) · 1.15 KB

README.md

File metadata and controls

60 lines (45 loc) · 1.15 KB

@teamleader/ddd-action-string npm version

Helpers to create domain-driven design (DDD) inspired action strings for Redux

Installation

NPM

npm i @teamleader/ddd-action-string

Yarn

yarn add @teamleader/ddd-action-string

Usage Example

import {
  createApplicationActionString,
  createDomainActionString,
  createRequestActionStrings,
} from '@teamleader/ddd-action-string';

createApplicationActionString({
  organisation: 'teamleader',
  application: 'calendar',
  domain: 'routing/calendars',
  action: 'goto_today',
});

// 'Teamleader/Calendar/Application/Routing/Calendars/GOTO_TODAY'

createDomainActionString({
  organisation: 'teamleader',
  domain: 'events',
  action: 'initialize',
});

// 'Teamleader/Domain/Events/INITIALIZE'

createRequestActionStrings({
  organisation: 'teamleader',
  domain: 'events',
  action: 'list',
});

/*
  [
    'Teamleader/Domain/Events/LIST_REQUEST',
    'Teamleader/Domain/Events/LIST_SUCCESS',
    'Teamleader/Domain/Events/LIST_FAILURE'
  ]
*/

MIT