-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
registerFactoryParam should receive a Record #332
Comments
That's a real Interesting idea, will look into it
Thomas
Am 29. Mai 2023, 17:36 +0200 schrieb Michel Feinstein ***@***.***>:
… registerFactoryParam and registerFactoryParamAsync have a very limited API. We can only pass 2 parameters and their names aren't descritive enough of their purposes.
With Records added to dart 3, I think we can make a braking change to these methods where they receive a Record instead. This way we can define what are our parameters with a Record, since a Record signature is pretty much a Function signature.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Besides removing one parameter, there would be no need to change anything, as a gerenic type can alredy be a recoed, or do I miss something here? |
I confess I still didn't play with Records, but as far as I understand yes, you only need to remove 1 parameter, so the function will only accept one generic parameter, then make it positional and not named, and then in the docs and readme explain how to use it with records. |
unfortunately optional positional parameters can't be mixed with named ones yet. therefore we would need to keep it a named one because we always have to offer the 'instanceName` parameter. |
Ah, OK, I didn't remember the parameters tbh, that's fine, I would just rename it to something else than |
I am open for any proposals what better name for a value that is passed as parameter
Am 30. Mai 2023, 17:23 +0200 schrieb Michel Feinstein ***@***.***>:
… Ah, OK, I didn't remember the parameters tbh, that's fine, I would just rename it to something else than param.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
|
registerFactoryParam
andregisterFactoryParamAsync
have a very limited API. We can only pass 2 parameters and their names aren't descritive enough of their purposes.With Records added to dart 3, I think we can make a braking change to these methods where they receive a Record instead. This way we can define what are our parameters with a Record, since a Record signature is pretty much the same a Function's parameter signature.
The text was updated successfully, but these errors were encountered: