0.1.2 • Published 4 years ago

em-pipeline v0.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

em-pipeline

API

  1. next : 方法用于执行下一个任务

2) skip : 方法用于执行下下个任务

  1. run : 开始运行任务

4) tap : 注册任务

DEMO

import { PipeLine } from 'em-pipeline';

const task1 = new PipeLine<{
  name: string;
}>();

task1
  .tap<{
    age: number;
  }>('测试1', (app, { next, skip }) => {
    console.log('run111');
    next({
      age: 18,
    });
  })
  .tap<{
    sex: string;
  }>('测试2', (app, { next, skip }) => {
    console.log('run222');
    const { age, name } = app;
    skip({
      sex: 'man',
    });
  })
  .tap('测试5', (app, { next }) => {
    console.log(app);
    next();
  })
  .tap('测试6', (app) => {
    console.log(app);
  });

task1.run({
  name: '1',
});
0.1.2

4 years ago

0.1.1

4 years ago

0.0.10

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.3

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

1.0.0

4 years ago