We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c20fb04 commit 02861bcCopy full SHA for 02861bc
2 files changed
src/capacitor/index.ts
@@ -142,7 +142,7 @@ export class FluxCapacitor extends EventEmitter {
142
143
private emitQueryChanged(oldQuery: string, newQuery: string) {
144
if (oldQuery.toLowerCase() !== newQuery.toLowerCase()) {
145
- this.emit(Events.QUERY_CHANGED);
+ this.emit(Events.QUERY_CHANGED, newQuery);
146
}
147
148
test/capacitor.ts
@@ -118,7 +118,10 @@ describe('FluxCapacitor', function() {
118
flux.bridge.search = (): any => Promise.resolve('ok');
119
120
flux.search('shoes')
121
- .then(() => flux.on(Events.QUERY_CHANGED, () => done()))
+ .then(() => flux.on(Events.QUERY_CHANGED, (query) => {
122
+ expect(query).to.eq('other');
123
+ done();
124
+ }))
125
.then(() => flux.search('other'));
126
});
127
0 commit comments