Skip to content

Commit

Permalink
Udate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hmlongco committed Apr 27, 2023
1 parent 69521a4 commit 7ace085
Show file tree
Hide file tree
Showing 190 changed files with 190 additions and 184 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Factory is strongly influenced by SwiftUI, and in my opinion is highly suited fo
- **Concise**: Defining a registration usually takes just a single line of code. Same for resolution.
- **Flexible**: Working with UIKIt or SwiftUI? iOS or macOS? Using MVVM? MVP? Clean? VIPER? No problem. Factory works with all of these and more.
- **Documented**: Factory 2.0 has extensive DocC documentation and examples covering its classes, methods, and use cases.
- **Lightweight**: With all of that Factory is slim and trim, under 700 lines of executable code.
- **Lightweight**: With all of that Factory is slim and trim, under 800 lines of executable code.
- **Tested**: Unit tests with 100% code coverage helps ensure correct operation of registrations, resolutions, and scopes.
- **Free**: Factory is free and open source under the MIT License.

Expand Down
2 changes: 1 addition & 1 deletion Sources/Factory/Factory.docc/Factory.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Factory is...
- **Concise**: Defining a registration usually takes just a single line of code. Same for resolution.
- **Flexible**: Working with UIKIt or SwiftUI? iOS or macOS? Using MVVM? MVP? Clean? VIPER? No problem. Factory works with all of these and more.
- **Documented**: Factory 2.0 has extensive DocC documentation and examples covering its classes, methods, and use cases.
- **Lightweight**: With all of that Factory is slim and trim, under 700 lines of executable code.
- **Lightweight**: With all of that Factory is slim and trim, under 800 lines of executable code.
- **Tested**: Unit tests with 100% code coverage helps ensure correct operation of registrations, resolutions, and scopes.
- **Free**: Factory is free and open source under the MIT License.

Expand Down
2 changes: 1 addition & 1 deletion Sources/Factory/Factory/Registrations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public struct FactoryRegistration<P,T> {
globalRecursiveLock.lock()
unsafeCheckAutoRegistration()
let manager = container.manager
var options = manager.options[id] ?? FactoryOptions(scope: manager.defaultScope)
var options = manager.options[id] ?? FactoryOptions()
if options.once == once {
mutate(&options)
manager.options[id] = options
Expand Down
2 changes: 1 addition & 1 deletion docs/data/documentation/factory.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/data/documentation/factory/autoregistering.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"AutoRegistering"}],"languages":["swift"],"platforms":["macOS"]}]},{"kind":"content","content":[{"anchor":"overview","level":2,"type":"heading","text":"Overview"},{"type":"paragraph","inlineContent":[{"type":"text","text":"Add this protocol to a container to support first-time registration of needed dependencies prior to first resolution"},{"type":"text","text":" "},{"type":"text","text":"of a dependency on that container."}]},{"type":"codeListing","syntax":"swift","code":["extension Container: AutoRegistering {"," func autoRegister() {"," someService.register {"," CrossModuleService()"," }"," }","}"]},{"type":"paragraph","inlineContent":[{"type":"text","text":"The "},{"type":"codeVoice","code":"autoRegister"},{"type":"text","text":" function is called on each instantiated container prior to"},{"type":"text","text":" "},{"type":"text","text":"the first resolution of a Factory on that container."}]},{"style":"warning","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Calling "},{"type":"codeVoice","code":"container.manager.reset(options: .all)"},{"type":"text","text":" restores the container to it’s initial state"},{"type":"text","text":" "},{"type":"text","text":"and autoRegister will be called again if it exists."}]}],"type":"aside","name":"Warning"}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/factory\/autoregistering"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/Factory\/documentation\/Factory\/AutoRegistering","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"Adds an registration “hook” to a "},{"type":"codeVoice","code":"Container"},{"type":"text","text":"."}],"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"AutoRegistering"}],"title":"AutoRegistering","roleHeading":"Protocol","role":"symbol","symbolKind":"protocol","externalID":"s:7Factory15AutoRegisteringP","modules":[{"name":"Factory"}],"navigatorTitle":[{"kind":"identifier","text":"AutoRegistering"}]},"hierarchy":{"paths":[["doc:\/\/Factory\/documentation\/Factory"]]},"topicSections":[{"title":"Instance Methods","identifiers":["doc:\/\/Factory\/documentation\/Factory\/AutoRegistering\/autoRegister()"]}],"references":{"doc://Factory/documentation/Factory/AutoRegistering/autoRegister()":{"role":"symbol","title":"autoRegister()","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"autoRegister"},{"kind":"text","text":"()"}],"abstract":[{"type":"text","text":"User provided function that supports first-time registration of needed dependencies prior to first resolution"},{"type":"text","text":" "},{"type":"text","text":"of a dependency on that container."}],"identifier":"doc:\/\/Factory\/documentation\/Factory\/AutoRegistering\/autoRegister()","kind":"symbol","required":true,"type":"topic","url":"\/documentation\/factory\/autoregistering\/autoregister()"},"doc://Factory/documentation/Factory/AutoRegistering":{"role":"symbol","title":"AutoRegistering","fragments":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"AutoRegistering"}],"abstract":[{"type":"text","text":"Adds an registration “hook” to a "},{"type":"codeVoice","code":"Container"},{"type":"text","text":"."}],"identifier":"doc:\/\/Factory\/documentation\/Factory\/AutoRegistering","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"AutoRegistering"}],"url":"\/documentation\/factory\/autoregistering"},"doc://Factory/documentation/Factory":{"role":"collection","title":"Factory","abstract":[{"type":"text","text":"A new approach to Container-Based Dependency Injection for Swift and SwiftUI."}],"identifier":"doc:\/\/Factory\/documentation\/Factory","kind":"symbol","type":"topic","url":"\/documentation\/factory"}}}
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"AutoRegistering"}],"languages":["swift"],"platforms":["macOS"]}]},{"kind":"content","content":[{"anchor":"overview","level":2,"type":"heading","text":"Overview"},{"type":"paragraph","inlineContent":[{"type":"text","text":"Add this protocol to a container to support first-time registration of needed dependencies prior to first resolution"},{"type":"text","text":" "},{"type":"text","text":"of a dependency on that container."}]},{"type":"codeListing","syntax":"swift","code":["extension Container: AutoRegistering {"," func autoRegister() {"," someService.register {"," CrossModuleService()"," }"," }","}"]},{"type":"paragraph","inlineContent":[{"type":"text","text":"The "},{"type":"codeVoice","code":"autoRegister"},{"type":"text","text":" function is called on each instantiated container prior to"},{"type":"text","text":" "},{"type":"text","text":"the first resolution of a Factory on that container."}]},{"style":"warning","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Calling "},{"type":"codeVoice","code":"container.manager.reset(options: .all)"},{"type":"text","text":" restores the container to it’s initial state"},{"type":"text","text":" "},{"type":"text","text":"and autoRegister will be called again if it exists."}]}],"type":"aside","name":"Warning"}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/factory\/autoregistering"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/Factory\/documentation\/Factory\/AutoRegistering","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"Adds an registration “hook” to a "},{"type":"codeVoice","code":"Container"},{"type":"text","text":"."}],"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"AutoRegistering"}],"title":"AutoRegistering","roleHeading":"Protocol","role":"symbol","symbolKind":"protocol","externalID":"s:7Factory15AutoRegisteringP","modules":[{"name":"Factory"}],"navigatorTitle":[{"kind":"identifier","text":"AutoRegistering"}]},"hierarchy":{"paths":[["doc:\/\/Factory\/documentation\/Factory"]]},"topicSections":[{"title":"Instance Methods","identifiers":["doc:\/\/Factory\/documentation\/Factory\/AutoRegistering\/autoRegister()"]}],"references":{"doc://Factory/documentation/Factory/AutoRegistering/autoRegister()":{"role":"symbol","title":"autoRegister()","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"autoRegister"},{"kind":"text","text":"()"}],"abstract":[{"type":"text","text":"User provided function that supports first-time registration of needed dependencies prior to first resolution"},{"type":"text","text":" "},{"type":"text","text":"of a dependency on that container."}],"identifier":"doc:\/\/Factory\/documentation\/Factory\/AutoRegistering\/autoRegister()","kind":"symbol","required":true,"type":"topic","url":"\/documentation\/factory\/autoregistering\/autoregister()"},"doc://Factory/documentation/Factory":{"role":"collection","title":"Factory","abstract":[{"type":"text","text":"A new approach to Container-Based Dependency Injection for Swift and SwiftUI."}],"identifier":"doc:\/\/Factory\/documentation\/Factory","kind":"symbol","type":"topic","url":"\/documentation\/factory"},"doc://Factory/documentation/Factory/AutoRegistering":{"role":"symbol","title":"AutoRegistering","fragments":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"AutoRegistering"}],"abstract":[{"type":"text","text":"Adds an registration “hook” to a "},{"type":"codeVoice","code":"Container"},{"type":"text","text":"."}],"identifier":"doc:\/\/Factory\/documentation\/Factory\/AutoRegistering","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"AutoRegistering"}],"url":"\/documentation\/factory\/autoregistering"}}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"autoRegister"},{"kind":"text","text":"()"}],"languages":["swift"],"platforms":["macOS"]}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/factory\/autoregistering\/autoregister()"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/Factory\/documentation\/Factory\/AutoRegistering\/autoRegister()","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"User provided function that supports first-time registration of needed dependencies prior to first resolution"},{"type":"text","text":" "},{"type":"text","text":"of a dependency on that container."}],"kind":"symbol","metadata":{"role":"symbol","title":"autoRegister()","roleHeading":"Instance Method","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"autoRegister"},{"kind":"text","text":"()"}],"symbolKind":"method","externalID":"s:7Factory15AutoRegisteringP12autoRegisteryyF","required":true,"modules":[{"name":"Factory"}]},"hierarchy":{"paths":[["doc:\/\/Factory\/documentation\/Factory","doc:\/\/Factory\/documentation\/Factory\/AutoRegistering"]]},"references":{"doc://Factory/documentation/Factory/AutoRegistering":{"role":"symbol","title":"AutoRegistering","fragments":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"AutoRegistering"}],"abstract":[{"type":"text","text":"Adds an registration “hook” to a "},{"type":"codeVoice","code":"Container"},{"type":"text","text":"."}],"identifier":"doc:\/\/Factory\/documentation\/Factory\/AutoRegistering","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"AutoRegistering"}],"url":"\/documentation\/factory\/autoregistering"},"doc://Factory/documentation/Factory":{"role":"collection","title":"Factory","abstract":[{"type":"text","text":"A new approach to Container-Based Dependency Injection for Swift and SwiftUI."}],"identifier":"doc:\/\/Factory\/documentation\/Factory","kind":"symbol","type":"topic","url":"\/documentation\/factory"},"doc://Factory/documentation/Factory/AutoRegistering/autoRegister()":{"role":"symbol","title":"autoRegister()","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"autoRegister"},{"kind":"text","text":"()"}],"abstract":[{"type":"text","text":"User provided function that supports first-time registration of needed dependencies prior to first resolution"},{"type":"text","text":" "},{"type":"text","text":"of a dependency on that container."}],"identifier":"doc:\/\/Factory\/documentation\/Factory\/AutoRegistering\/autoRegister()","kind":"symbol","required":true,"type":"topic","url":"\/documentation\/factory\/autoregistering\/autoregister()"}}}
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"autoRegister"},{"kind":"text","text":"()"}],"languages":["swift"],"platforms":["macOS"]}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/factory\/autoregistering\/autoregister()"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/Factory\/documentation\/Factory\/AutoRegistering\/autoRegister()","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"User provided function that supports first-time registration of needed dependencies prior to first resolution"},{"type":"text","text":" "},{"type":"text","text":"of a dependency on that container."}],"kind":"symbol","metadata":{"role":"symbol","title":"autoRegister()","roleHeading":"Instance Method","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"autoRegister"},{"kind":"text","text":"()"}],"symbolKind":"method","externalID":"s:7Factory15AutoRegisteringP12autoRegisteryyF","required":true,"modules":[{"name":"Factory"}]},"hierarchy":{"paths":[["doc:\/\/Factory\/documentation\/Factory","doc:\/\/Factory\/documentation\/Factory\/AutoRegistering"]]},"references":{"doc://Factory/documentation/Factory":{"role":"collection","title":"Factory","abstract":[{"type":"text","text":"A new approach to Container-Based Dependency Injection for Swift and SwiftUI."}],"identifier":"doc:\/\/Factory\/documentation\/Factory","kind":"symbol","type":"topic","url":"\/documentation\/factory"},"doc://Factory/documentation/Factory/AutoRegistering":{"role":"symbol","title":"AutoRegistering","fragments":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"AutoRegistering"}],"abstract":[{"type":"text","text":"Adds an registration “hook” to a "},{"type":"codeVoice","code":"Container"},{"type":"text","text":"."}],"identifier":"doc:\/\/Factory\/documentation\/Factory\/AutoRegistering","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"AutoRegistering"}],"url":"\/documentation\/factory\/autoregistering"},"doc://Factory/documentation/Factory/AutoRegistering/autoRegister()":{"role":"symbol","title":"autoRegister()","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"autoRegister"},{"kind":"text","text":"()"}],"abstract":[{"type":"text","text":"User provided function that supports first-time registration of needed dependencies prior to first resolution"},{"type":"text","text":" "},{"type":"text","text":"of a dependency on that container."}],"identifier":"doc:\/\/Factory\/documentation\/Factory\/AutoRegistering\/autoRegister()","kind":"symbol","required":true,"type":"topic","url":"\/documentation\/factory\/autoregistering\/autoregister()"}}}
Loading

0 comments on commit 7ace085

Please sign in to comment.