Skip to content

Commit

Permalink
Added empty call as function for generic elements
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasBellucci committed Jul 23, 2021
1 parent 117d98d commit 228feec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Mongrel/HTML/Elements/General/GenericElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public struct GenericElement: Attributable {
self.tag = tag
}

public func callAsFunction() -> GenericElement {
return self
}

public func callAsFunction(@HTMLBuilder _ content: () -> HTMLConvertible) -> GenericElement {
var copy = self
copy.innerHTML = content().stringValue
Expand Down

0 comments on commit 228feec

Please # to comment.