BuilderIO / BuilderIO/mitosis

setContext to pass a factory function

Open
#382 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

angular core web-components
Dominant language
TypeScript
Stars
14.4k
Forks
672
PR merge metrics
No merged PRs in 30d

Description

it would be great if we could pass a factory function to setContext

setContext(() => createInjector());

setContext(createInjector);

setContext(() => {
  return {
    get: (token) => inject(token);
  };
});

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate setContext and its existing tests, then trace how the current context value is consumed. Compare the requested factory forms, determine the expected behavior for each, and add coverage showing that the supported forms produce the intended context.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.