Skip to content

Instantly share code, notes, and snippets.

@wavded

wavded/blamda.js

Created Jan 25, 2012
Embed
What would you like to do?
block-lambda would be nice
var OrderManager = {
getRecordById: function (id) {
function gridCheck (TypeOrder) {
if (TypeOrder != null) {
var record = TypeOrder.getGrid().store.getById(id)
if (record) {
return { // would like the parent function to exit here (but ain't gonna happen)
record: record,
grid: TypeOrder.getGrid()
}
}
}
}
gridCheck(UnassignedOrder)
gridCheck(SavedOrder)
}
}
// Would be nice to say:
let OrderManager = {
getRecordById: function (id) {
let gridCheck = { |TypeOrder|
if (TypeOrder != null) {
let record = TypeOrder.getGrid().store.getById(id)
if (record) {
return { // return worked!
record: record,
grid: unassigned.getGrid()
}
}
}
}
gridCheck(UnassignedOrder)
gridCheck(SavedOrder)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.