Releases: joshuawright11/fusion
Releases · joshuawright11/fusion
v0.4.0
v0.3.0
Refactors the internals to provide a cleaner interface.
Binding is simplified; it creates values with either a factory closure with a Container parameter or a value @autoclosure
for providing a specific value.
bind(behavior:type:id:factory: (Container) -> T)
bind(behavior:type:id:value: @autoclosure () -> T)
Resolving is also simplified with three options.
resolve(_:id:) -> T?
resolves a service, returning nil if it isn't registeredresolveAssert(_:id:) -> T
resolves a service, failing an assertion if it isn't registeredresolveThrowing(_:id:) throws -> T
resolves a service, throwing a FusionError.notRegistered if it isn't registered.
v0.2.2
Under the hood changes to singleton storages so that @Inject
is equivalent to resolving with a nil identifier.
v0.2.1
Replaces already registered instances of singletons when re-registering a service.
v0.2.0
Cleans up Inject
so that it's get-only, meaning it won't throw errors when used concurrently with Swift's new concurrency features.
Also adds convenience functions for registering an instance of a type without having to specify its actual type.
Initial release
0.1.0 Add static defaults for working with Container.default