ryardley / ts-bus

A lightweight JavaScript/TypeScript event bus to help manage your application architecture.
MIT License
137 stars 8 forks source link

New `createEventDefinition` method #20

Closed ryardley closed 5 years ago

ryardley commented 5 years ago

PR Summary

Not a breaking change but includes a deprecation.

In response to https://github.com/ryardley/ts-bus/issues/9

TypeScript Example

import { createEventDefinition } from "ts-bus";

export const taskCreated = createEventDefinition<{
  id: string;
  listId: string;
  value: string;
}>()("task.created");

JavaScript Example

import { createEventDefinition } from "ts-bus";
import p from "pdsl";

export const taskLabelUpdated = createEventDefinition(p`{
  id: String,
  label: String,
}`)("task.label.updated");
codecov[bot] commented 5 years ago

Codecov Report

Merging #20 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #20   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines          26     40   +14     
  Branches        6     10    +4     
=====================================
+ Hits           26     40   +14
Impacted Files Coverage Δ
src/index.ts 100% <100%> (ø) :arrow_up:
src/EventBus.ts 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4fd905f...e4e90a4. Read the comment docs.