Bonfire
Writen by Tzach bonfil. github
Bonfire is open source decorators utils for angular.
- Make change detection easy
- Makes Observable for you
You can your code cleaner and simpler with adding just 2 decorators to your code.
We know that angular change detection is not simple if you want it to be officent, so I made Bonfire.
Simple solution to hard problem.
Now there is no use to call the change detection!
Installation
Bonfire requires Node.js v4+ to run.
Install the dependencies and devDependencies and start the server.
$ npm i @intelligo/bonfire
Where to use
Before you use it, make sure you inject the change detection to your component!
import { ReRenderOnChange, SetChecker, Observable } from '@intelligo.ai/bonfire';
@ReRenderOnChange()
@Component({
selector: 'my-component',
templateUrl: './my-component.component.html',
styleUrls: ['./my-component.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class SupportComponent {
@SetChecker() group: ISomeInterface;
@Observable() showLoader = false;
showLoader$: BehaviorSubject<boolean>;
constructor(
private cd: ChangeDetectorRef
) {}
}
Dependencies
Bonfire uses a number of open source projects to work properly:
- Angular - Platform for building mobile and desktop web applications.
- Rxjs - Reactive extensions library for javascript.
- uuid - Simple, fast generation of RFC4122 UUIDS.
Todos
License
MIT