Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sjurgis/0ad7c9702f58c4beb3bb3d3bd381d37d to your computer and use it in GitHub Desktop.
Save sjurgis/0ad7c9702f58c4beb3bb3d3bd381d37d to your computer and use it in GitHub Desktop.
Service components using lax
<aura:component controller="FooService">
<c:lax context="{!this}" />
<aura:method name="getByAppName">
<aura:attribute name="AppName" type="string" />
</aura:method>
</aura:component>
({
getByAppName : function(component, event, helper) {
return component.lax.enqueue('c.GetByAppName', event.getParam('arguments'))
}
})
<c:FooService aura:id="FooService" />
component
.find("FooService")
.getByAppName('baz')
.then(helper.getSuccess.bind(null, component, helper))
.then(helper.getFail.bind(null, component, helper))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment