Skip to content

Instantly share code, notes, and snippets.

select revisions from dir "/"
where
(path like "/**/your_project_root/src/main/**/*.coffee"
or path like "/**/your_project_root/src/main/**/*.jsp")
and is head
and not is deleted
and on branch develop
group by path
return path
Ext.define( "DeftQuickStart.DeftQuickStartApplication",
extend: "Deft.mvc.Application"
init: ->
console.log( "Init in Application" )
Deft.Injector.configure(
companyStore: "DeftQuickStart.store.CompanyStore"
)
Ext.Loader.setConfig(
enabled: true
paths:
"DeftQuickStart": "app/"
)
Ext.application
autoCreateViewport: false
name: "DeftQuickStart"
Ext.Loader.setConfig(
enabled: true
paths:
"DeftQuickStart": "app/"
)
Ext.application
autoCreateViewport: true
name: "DeftQuickStart"
var myMethod;
myMethod = function(firstArgument, _arg) {
var objectValue1, objectValue2;
objectValue1 = _arg.objectValue1, objectValue2 = _arg.objectValue2;
};
myMethod = ( firstArgument, { objectValue1, objectValue2 } ) ->
# do something
# Using a Promise
loadCompanies: ->
@companyService.loadCompanies().then(
success: ( records ) ->
# Do something with results
failure: ( error ) ->
# Do something with the error
).always( ->
# Do something whether the call succeeded or failed
)
# Common way of making async call via underlying Store
loadCompanies: ->
@companyService.loadCompanies(
callback: ( records, operation, success ) ->
if( success )
# Do something with results
else
# Do something with the error
# Do something whether the call succeeded or failed
# Using a Promise for a chain of async calls
loadInitialData: ->
@companyService.loadInitialData().then(
success: ( records ) ->
# Do something with results
failure: ( error ) ->
# Do something with the error
).always( ->
# Do something whether the call succeeded or failed
)
# Ill-advised attempt to make a chain of async call via underlying Store
loadInitialData: ->
@companyService.loadCompanies(
callback: ( companyRecords, operation, success ) ->
if( success )
@companyService.loadFeaturedProducts(
callback: ( productRecords, operation, success ) ->
if( success )
# Do something with both sets of results
else