From 241baac6928a8b3dfff5506173ee8e333058ad71 Mon Sep 17 00:00:00 2001 From: Ricardo Casanova Date: Fri, 20 Sep 2024 19:01:15 +0200 Subject: [PATCH] Add a static factory method --- TCA.xctemplate/___FILEBASENAME___View.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/TCA.xctemplate/___FILEBASENAME___View.swift b/TCA.xctemplate/___FILEBASENAME___View.swift index 4e59854..c399cf3 100644 --- a/TCA.xctemplate/___FILEBASENAME___View.swift +++ b/TCA.xctemplate/___FILEBASENAME___View.swift @@ -29,6 +29,20 @@ struct ___VARIABLE_moduleName___View: View { } } +// MARK: - Factory + +extension ___VARIABLE_moduleName___View { + static func make() -> Self { + ___VARIABLE_moduleName___View( + store: .init( + initialState: ___VARIABLE_moduleName___.State() + ) { + ___VARIABLE_moduleName___() + } + ) + } +} + #if DEBUG // MARK: Previews