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

injectMap()() #58

Open
mrWh1te opened this issue Aug 26, 2020 · 1 comment
Open

injectMap()() #58

mrWh1te opened this issue Aug 26, 2020 · 1 comment
Labels
botaction proposal New feature or change

Comments

@mrWh1te
Copy link
Owner

mrWh1te commented Aug 26, 2020

This sets the first inject with a hash-map of injectables for assembled BotAction's

This can be helpful if you have advanced injecting needs, as a way to distinguish injectables by key.

Goal is to resolve deep nesting of higher-order injectors, because then the functions assembled within, have an imposed injects order (inner array typing) that couples the functions to a particular injects structure, it gets worse the deeper nested you go. So if you need to make a major injector change, like in React, adding new Provider Context component, it can impose large amounts of required dev work to update other functions with new injects order, unless you just add it to the end, over and over again, which then imposes structure on itself in how injectors are assembled in the Bot.

By advancing injects with keys, slight more control can be gained to de-couple some of the imposed order.

Purely concept, the goal is more important

It would be nice to be able to use this over and over again, in a nesting way, that continues to enrich that same 1st injected hash-map with new injectables. Or would it be nice to collect injectables in various hash-maps injected as new injects, as nesting occurs? Maybe on assembly customizable?

Key collisions could override?

@mrWh1te mrWh1te added proposal New feature or change botaction labels Aug 26, 2020
@mrWh1te
Copy link
Owner Author

mrWh1te commented Aug 26, 2020

another approach could be to extend inject()() with 1 other param like orderNumber, injectsIndex, to dynamically set the injects order of assembled BotAction's, but how would that "state" be passed down when overridden with nested inject()()'s

some kind of injects sorter, maybe with the ability to set index / inject while maintaining that with further nested inject()()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
botaction proposal New feature or change
Projects
None yet
Development

No branches or pull requests

1 participant