Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typeahead): improve 'ngbTypeahead' typings #4038

Merged

Conversation

maxokorokov
Copy link
Member

Improves "search" function typings by using standard rxjs OperatorFunction type and making search function optional

// before
@Input() ngbTypeahead: (text: Observable<string>) => Observable<readonly any[]>;

// after
@Input() ngbTypeahead: OperatorFunction<string, readonly any[]>| null | undefined;

Fixes #3907

Improves "search" function typings by using standard rxjs `OperatorFunction` type and making search function optional

```ts
// before
@input() ngbTypeahead: (text: Observable<string>) => Observable<readonly any[]>;

// after
@input() ngbTypeahead: OperatorFunction<string, readonly any[]>| null | undefined;
```

Fixes ng-bootstrap#3907
@maxokorokov maxokorokov added this to the 9.1.0 milestone Mar 18, 2021
@codecov-io
Copy link

Codecov Report

Merging #4038 (c953042) into master (67be4ab) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4038   +/-   ##
=======================================
  Coverage   88.07%   88.08%           
=======================================
  Files         112      112           
  Lines        3589     3591    +2     
  Branches      663      664    +1     
=======================================
+ Hits         3161     3163    +2     
  Misses        358      358           
  Partials       70       70           
Flag Coverage Δ
e2e 46.55% <44.44%> (-0.09%) ⬇️
unit 87.37% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/typeahead/typeahead.ts 96.06% <100.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67be4ab...c953042. Read the comment docs.

@maxokorokov maxokorokov merged commit 81f2c59 into ng-bootstrap:master Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

typeahead: Add '| undefined' to ngbTypeahead typings
2 participants