softwaremill / softwaremill/macwire
Documentation - factories - usage not shown
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1.3k
- Forks
- 77
- Avg merge
- 9m
- Merged PRs (30d)
- 4
Description
The section on factories shows two alternatives on how to define a factory:
def taxCalculator(taxBase: Double) = wire[TaxCalculator]
// or: lazy val taxCalculator = (taxBase: Double) => wire[TaxCalculator]
It does not show though, how a class can depend on such factory.
This answer on SO shows, how to inject a factory defined in a val (or lazy val) - second line in the documentation snippet
However, I have found no way on how to inject a factory, which is defined using a def - first line in the documentation snippet.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the factories section containing the taxCalculator def and lazy-val examples, then review the linked Stack Overflow answer for the existing val-based injection pattern. Verify whether a factory defined with def can be injected, and update the documentation to show the supported usage or explain the limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100