get_it
get_it copied to clipboard
registerFactoryParam should receive a Record
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 the same a Function's parameter signature.
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 param
.
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: @.***>
args
... just kidding, I can't come up with a better name, I didn't realize we can't remove it.