I am currently building a library where it would be useful to allow people using it to specify a section of their own code to run in the middle of the library functionality.
For example much like an async task does with its onPreExecute etc methods or how an on event listener does.
However I have no idea how to go about creating this and the correct keywords that would point me towards answers are eluding me from my searches.
Specifically I would like to implement something like:
LoadingKit.performSomeCode (new thing () {
\\code goes here
}).otherImportantMethods ();
Apologies for the vagueness and any help would be great.