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

Change examples to use Selector.with(payload) instead of Command::new() #1735

Closed
arthmis opened this issue Apr 24, 2021 · 2 comments
Closed
Labels
docs concerns documentation examples concerns examples

Comments

@arthmis
Copy link
Collaborator

arthmis commented Apr 24, 2021

It seems it wouldn't be idiomatic? druid to use Command::new() directly and users should be pushed to use Selector to create commands. Currently the examples use Command new, so it would be nice to change any uses of Command::new() to MySelector.with(). Is this right? @cmyr

old way:

    const ExampleSelector: Selector<u64> = Selector::new("example-selector");
    Command::new(ExampleSelector, 45u64, Target::Auto);

now it should be

    const ExampleSelector: Selector<u64> = Selector::new("example-selector");
    ExampleSelector.with(45u64);
@arthmis arthmis added docs concerns documentation examples concerns examples labels Apr 24, 2021
@cmyr
Copy link
Member

cmyr commented Apr 24, 2021

Yes, I think this is the most ergonomic way to use these API. Thanks!

@arthmis
Copy link
Collaborator Author

arthmis commented May 8, 2021

Closed with #1761

@arthmis arthmis closed this as completed May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs concerns documentation examples concerns examples
Projects
None yet
Development

No branches or pull requests

2 participants