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

RiskyDiceRoller #23982

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

ChumpChief
Copy link
Contributor

@ChumpChief ChumpChief commented Mar 4, 2025

Example of allowing the container code author to selectively inject a runtime-level superpower into a datastore that's willing to take it. dispose() isn't the best example since the container code author probably shouldn't even be calling it anyway, but it's funny :). Imagine I'm calling getAudience() or something instead.

Alternatives might include leaving the factory alone but having the datastore's entryPoint be a creator function, i.e. entryPoint of { createRiskyDiceRoller: (disposeContainer: () => void): IDiceRoller } and then have the container code's entry point complete the creation after getDataStoreEntryPoint and before returning its entryPoint. But here I'm confident that the RiskyDiceRoller won't use before initialize so I just pass it directly.

@github-actions github-actions bot added area: examples Changes that focus on our examples base: main PRs targeted against main branch labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples Changes that focus on our examples base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant