Skip to content

Commit

Permalink
fixed typo and hummingbird example update (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
sliemeobn authored Sep 13, 2024
1 parent d73d3b3 commit 85f61a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Examples/HummingbirdDemo/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let package = Package(
.executable(name: "App", targets: ["App"]),
],
dependencies: [
.package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0-rc.5"),
.package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0"),
.package(url: "https://github.com/hummingbird-community/hummingbird-elementary.git", from: "0.2.0-rc.1"),
.package(path: "../../"),
.package(url: "https://github.com/apple/swift-async-algorithms", from: "1.0.0"),
Expand Down
4 changes: 2 additions & 2 deletions Examples/HummingbirdDemo/Sources/App/Routes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ func addRoutes(to router: Router<some RequestContext>) {
status: .ok,
headers: [.contentType: "text/event-stream"],
body: .init { writer in
while true {
for await _ in AsyncTimerSequence.repeating(every: .seconds(1)).cancelOnGracefulShutdown() {
try await writer.write(ByteBuffer(string: "data: \(TimeHeading().render())\n\n"))
try await Task.sleep(for: .seconds(1))
}
try await writer.finish(nil)
}
)
}
Expand Down
10 changes: 8 additions & 2 deletions Sources/ElementaryHTMX/HTMLAttributeValue+HTMX.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ public extension HTMLAttributeValue.HTMX {
public static var textContent: Self { "textContent" }
public static var beforeBegin: Self { "beforebegin" }
public static var afterBegin: Self { "afterbegin" }
public static var beforEend: Self { "beforeend" }
public static var beforeEnd: Self { "beforeend" }
public static var afterEnd: Self { "afterend" }
public static var delete: Self { "delete" }
public static var none: Self { "none" }

@available(*, deprecated, renamed: "beforeEnd")
public static var beforEend: Self { "beforeend" }
}

struct ModifiedSwapTarget: RawRepresentable {
Expand All @@ -43,11 +46,14 @@ public extension HTMLAttributeValue.HTMX {
public static var textContent: Self { .init(.textContent) }
public static var beforeBegin: Self { .init(.beforeBegin) }
public static var afterBegin: Self { .init(.afterBegin) }
public static var beforEend: Self { .init(.beforEend) }
public static var beforeEnd: Self { .init(.beforeEnd) }
public static var afterEnd: Self { .init(.afterEnd) }
public static var delete: Self { .init(.delete) }
public static var none: Self { .init(.none) }
public static var `default`: Self { .init("") }

@available(*, deprecated, renamed: "beforeEnd")
public static var beforEend: Self { .init(.beforEend) }
}
}

Expand Down

0 comments on commit 85f61a0

Please sign in to comment.