Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (13 sloc) 471 Bytes
var store = window.db['<%= data[:store] %>'];
var methodsPayload = JSON.parse(<%= data[:methods].to_json.inspect %>);
methodsPayload.forEach(function(methodPayload) {
var method = methodPayload['method'];
var arguments = methodPayload['arguments'];
console.log("Executing", method, "with", arguments);
store = store[method].apply(store, arguments);
});
store.then(function(data) {
<%= success(js[:data]) %>
}).catch(function(err) {
<%= error(js[:err]) %>
})