Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/suspense/main.templ
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import (
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
// Create a channel to send deferred component renders to the template.
data := make(chan SlotContents)
// Buffer for the known 3 slots so a goroutine never blocks on send if
// the client disconnects before the template finishes reading.
data := make(chan SlotContents, 3)

// We know there are 3 slots, so start a WaitGroup.
var wg sync.WaitGroup
Expand Down
4 changes: 3 additions & 1 deletion examples/suspense/main_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.