2017-06-13 15 views

答えて

0

あなたはこのような何かを探しているように聞こえる:

function handleEvent(event, snapshot, optionalPreviousChildKey) { 
    switch (event) { 
    case "child_added": ... 
     break; 
    ... 
    } 
} 
ref.on("child_added", function(snapshot, previousChildKey) { handleEvent("child_added", snapshot, previousChildKey); }) 
ref.on("child_changed", function(snapshot, previousChildKey) { handleEvent("child_changed", snapshot); }) 
ref.on("child_moved", function(snapshot, previousChildKey) { handleEvent("child_moved", snapshot, previousChildKey); }) 
ref.on("child_removed", function(snapshot) { handleEvent("child_removed", snapshot); }) 
関連する問題