@tsdi/platform-browser-activities
TypeScript icon, indicating that this package has built-in type declarations

6.0.48 • Public • Published

packaged @tsdi/platform-browser-activities

@tsdi/platform-browser-activities is activities framework for browser, base on AOP, Ioc container, via @tsdi. file stream pipes activities.

This repo is for distribution on npm. The source for this module is in the main repo. Please file issues and pull requests against that repo.

Install

  1. install modules:
npm install @tsdi/platform-browser-activities
  1. install cli | build pack:

cli in global

npm install -g '@tsdi/cli'

build pack

npm install '@tsdi/pack'

use command: pk run [taskfile.ts], pk run [taskfile.js]

You can import modules:

Doc

Define Task

  • Single task
@Task('test')
class SimpleTask extends AbstractTask implements ITask {

    constructor(name: string) {
        super(name);
    }

    run(): Promise<any> {
        // console.log('before simple activity:', this.name);
        return Promise.resolve('simple task')
            .then(val => {
                console.log('return simple activity:', val);
                return val;
            });
    }
}
  • control flow activities.

see control flow codes

  • Task module

Run task

1.
let wf = new Worflow(moudles)
2.
Workflow.create( moudles)
    .bootstrap(<IConfigure>{
        ...
        activity:...
    });
3.
Workflow.create( moudles)
    .bootstrap(TestTask);
4.
Workflow.create()
    .sequence(TestTask, TsCompile, <IConfigure>{
        ...
        activity: ...
    });
5.
Workflow.create()
    .run(...[TestTask, TsCompile, <IConfigure>{
        ...
        activity: ...
    }]);

Documentation

Documentation is available on the

License

MIT © Houjun

Package Sidebar

Install

npm i @tsdi/platform-browser-activities

Weekly Downloads

0

Version

6.0.48

License

MIT

Unpacked Size

105 kB

Total Files

28

Last publish

Collaborators

  • houjun