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

allow multiple parameters #10

Open
maks opened this issue Dec 11, 2019 · 2 comments
Open

allow multiple parameters #10

maks opened this issue Dec 11, 2019 · 2 comments

Comments

@maks
Copy link

maks commented Dec 11, 2019

I really love this package and would like to use it instead of my own hand-rolled solution, but I need to be able to pass in multiple parameters for some messages. Would it be possible to add that as an option?

@KingWu
Copy link
Owner

KingWu commented Dec 11, 2019

Any example to present your idea?

@maks
Copy link
Author

maks commented Dec 12, 2019

Yes sorry fo the lack of detail.
What I had in mind was being able to have thins like:

{
    "messageWithMultiParams": "Hi ${yourName} its ${now} and the temperature outside is ${temp}"
}

I'm not sure about what the best function signature, ideally we could have:

 S.of(context).messageWithMultiParams(yourname: 'Maks', now: '10:12am', temp: '21C');

with the named params also being marked with @required but even just passing in a List or Map as the param would be ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants