NgxFiFuse
fuse as ngx-fi-fuse
Installation
npm i fuse.js --save
npm i ngx-fi-fuse --save
How to use
In a module
import { NgModule } from "@angular/core";
import { NgxFiFuseModule } from "ngx-fi-fuse";
@NgModule({
imports: [NgxFiFuseModule],
exports: [NgxFiFuseModule]
})
export class SomeModule {}
Where required
import { Inject } from "@angular/core";
import { FuseOptions } from "fuse.js";
import { FuseFactoryDefinition, FUSE_TOKEN } from "ngx-fi-fuse";
export interface SomeItem {}
export class SomeClass {
constructor(@Inject(FUSE_TOKEN) private fuseFactory: FuseFactoryDefinition) {
const collection: SomeItem[] = [];
const options: FuseOptions<SomeItem> = {};
const fuse = this.fuseFactory<SomeItem>(collection, options);
}
}
For testing
import { NgxFiFuseModule } from "ngx-fi-fuse";
import { FuseFactoryDefinition, FUSE_TOKEN } from "ngx-fi-fuse";
describe('TestingTitle', () => {
let fuseFactory: FuseFactoryDefinition;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [NgxFiFuseModule]
});
fuseFactory = TestBed.get(FUSE_TOKEN);
}));
}));
}));