1.0.4 • Published 5 years ago
@kumanu/bloc v1.0.4
BLoC Schematic Generator for Angular
This Schematic implementation defines schematics for the BLoC (Business Logic Component) pattern for use in Angular applications.
Installation
npm install @kumanu/bloc
Usage
ng g @kumanu/bloc:bloc [name*] [eventType] [requestType] [initialValue]
Parameters:
- name (*required)
- eventType - incoming event stream data type (defaults to T which must be replaced)
- requestType - outgoing state stream data type (defaults to T which must be replaced)
- initialValue - sets an initial value for the outgoing state stream (defaults to null)
Testing
This schematic cannot be tested locally, it must be tested from within an Angular application.
Unit Testing
npm run test
will run the unit tests, using Jasmine as a runner and test framework.
Publishing
To publish, simply do:
npm run build
npm publish
That's it!