forked from cory/tildefriends
Do app -> client communication more like tfrpc so that it's easier to get responses.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3956 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -14,6 +14,9 @@ if (k_is_browser) {
|
||||
function make_rpc(target, prop, receiver) {
|
||||
return function() {
|
||||
let id = g_next_id++;
|
||||
while (!id || g_calls[id]) {
|
||||
id = g_next_id++;
|
||||
}
|
||||
let promise = new Promise(function(resolve, reject) {
|
||||
g_calls[id] = {resolve: resolve, reject: reject};
|
||||
});
|
||||
|
Reference in New Issue
Block a user