Skip to content

Avoid timeout and others #1

Closed
Closed
@julianobrasil

Description

@julianobrasil

Is it possible to avoid the setTimeout? As you plan a future PR in material 2 repo, the team avoids using setTimeout's.

https://github.com/OasisDigital/angular-material-obs-autocomplete/blob/b5e1a5fdd43b7a8e0391760e84acb2b26c97fc52/src/app/obs-autocomplete/obs-autocomplete-base.ts#L42-L49

You could take a look in MatAutocompleteTrigger.panelClosingActions as it's shown over here: angular/components#3334 (comment)

Also, there are recommendations about coding in Material repo: https://github.com/angular/material2/blob/master/CODING_STANDARDS.md

I've noticed the code style is a very important aspect among the guys developing Material. Tests are mandatory. You'll have to write them.

And, above all that... ask them whether you should be doing it before spending time preparing your PR. Not all features in Material Repo are opened for direct contribution. This kind of feature seems to me it's something that should be part of the project core. So there's a guideline that any core feature must be exhaustively discussed (internally to Google). Force selection is in this step (you can be sure that a topic with more than 40 comments is not being ignored by the project leader, Jeremy).

Rejecting PR's is not so frequent, but if your work is out of sync with their timeline, it can be frozen for months or even years awaiting for a merging action (and it's possible that you'll have to rebase it then).

Dispite of all this bureaucracy thing, I think your component is very nice, and your examples are really great (but the setTimeout thing... I don't like the idea of counting on timing to take actions - even in this case, where aparently you are just pushing the subscription to the end of the line in the event loop).

[edited]: shouldn't it be this.selectedValueSub = this.selectedValue.pipe(...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions