static void OnSuccess(Xhr xhr, FnVoidA fn) { dynamic response = xhr.Response; if (fn is FnVoidA) { fn(response); } }
static void Send(string path, FnVoidA fn) { Xhr xhr = new Xhr { Method = "GET", Url = string.Format("/data/{0}.json", path) }; xhr.AddListener("success", () => { OnSuccess(xhr, fn); }); xhr.Send(); }