Справочник API собран из Go doc-комментариев в исходном коде и написан на английском языке.
package datatablewatch
import "github.com/nsgo-dev/game/pkg/datatable/datatablewatch"Обзор
Package datatablewatch adds hot reload to datatable.Table through a tooling/hotreload.Watcher.
It lives outside datatable so a headless build, such as a dedicated server, imports datatable without NSGo: only the game client links the watcher.
Указатель
Функции
func Watch[T any](tbl *datatable.Table[T], watcher *hotreload.Watcher, onReload func([]T))Watch registers tbl's file with watcher and invokes onReload with the updated rows on the engine goroutine whenever a valid edit is saved.
Invalid edits keep the previous valid rows intact and record the error in tbl.LastError.
func WatchWithError[T any](tbl *datatable.Table[T], watcher *hotreload.Watcher, onReload func([]T, error))WatchWithError registers tbl's file with watcher and invokes onReload with either the new rows (err == nil) or the parse error (rows == previous valid rows).