SpellMixin

The SpellMixin interface was added to get spell data without the risk of it returning empty data.
: Source: FrameXML\ObjectAPI\Spell.lua
== API ==
* Spell:CreateFromSpellID(spellID) : spell - Creates an object from a spell ID.
=== Methods ===
* SpellMixin:SetSpellID(spellID)
* SpellMixin:GetSpellID() : spellID
* SpellMixin:Clear()
* SpellMixin:IsSpellEmpty() : boolean
* SpellMixin:IsSpellDataCached() : boolean
* SpellMixin:GetSpellName() : name
* SpellMixin:GetSpellTexture() : texture
* SpellMixin:GetSpellSubtext() : subtext
* SpellMixin:GetSpellDescription() : description
* SpellMixin:ContinueOnSpellLoad(callbackFunction)
* SpellMixin:ContinueWithCancelOnSpellLoad(callbackFunction) : cancelFunc
==ContinueOnSpellLoad==
Some spell data - such as subtext and description - are load on demand. You can use SpellMixin:ContinueOnSpellLoad() to asynchronously query the data.
local spell = Spell:CreateFromSpellID(139)
spell:ContinueOnSpellLoad(function()
	local name = spell:GetSpellName()
	local desc = spell:GetSpellDescription()
	print(name, desc) -- "Renew", "Fill the target with faith in the light, healing for 295 over 15 sec."
end)
 Certain spells might not return information when using :ContinueOnSpellLoad. For example spellID 10444 will return info for and but will have success:false, possibly because of an error with other data like the spell description.This will make :ContinueOnSpellLoad never fire the callback. One workaround is to use :ContinueWithCancelOnSpellLoad with a timeout or directly listen to SPELL_DATA_LOAD_RESULT.
== Patch changes ==
* 
== See also ==
* () -> 
== External links ==
== References ==