interface Loader<T>
{
function load():Void;
var loaded:EventSignal<Loader<T>, LoaderEvent<T>>;
var content:T;
}// for example some value object
class Data
{
public var foo:String;
}
// which means these are interchangeable in your application
class JsonDataLoader implements Loader<Data> { ... }
class XmlDataLoader implements Loader<Data> { ... }var http = new HttpMock();
http.respondTo("test.txt").with(Data("Some content").afterDelay(10);
http.respondTo("another.xml").with(Error("#404 Not Found"));Le 09/08/2012 14:46, David Peek a écrit :Thank you for all these great libraries !
Hello again!
Massive released another little library to haxelib today - mloader.
You should register mlotd.com "Massive Library of the Day" ;)
Best,
Nicolas
Le 09/08/2012 14:46, David Peek a �crit :
--
Oh, so this is how you reply to author :P
class LoaderQueue implements Loader<Array<Loader<Dynamic>>>
This is Dynamic because you can put any kind of loader into a queue, and as there is not LoaderQueue API for getting loaders it wouldn't really bring you any more type safety.
In the past with loading I actually managed to allow users to choose between hxs hsl signal types, it would be nice if your able to abstract any dependancy on mSignal
While I agree it's nice to let people choose, in this case the events are quite central to the library and rely on some msignal specific features. Neither library is very big, so worst case scenario someone needs to fork to replace one with the other.
does not seem to provide the ability to change the application domain, for instance there is no structure for loading a third party swf, where you may also want to provide some default minimal communication
The SwfLoader in the library is very minimal, and is used (by use at least) to simply load assets into the current domain for use as a library with getDefinitionByName. Very simple to extend and override methods to get more bespoke behaviour. I'm a big believer in YAGNI.
There is no CSV parser which can be useful, my main problem with CSV parser is defining the structure externally, but anyway maybe worth adding.
Again, not sure loading CSV is a terribly common use case.. but in this case easy enough to add without adding weight to everyones executables. Happy to take a contribution :)
Very good your sharing this code, I would love a tutorial on the MVC you posted
Checkout the example app, which demonstrates features (but ends up looking like a lot of work for very little functionality). As Dom said before, explaining MVC is always a double edge sword: you try to keep the example small, but as a result you end up with more boiler plate that application. It only really starts to make sense when you've been working on the same app for 3 months with 5 people and haven't gone insane from a lack of structure :)Best,David
On Thursday, August 9, 2012 at 3:32 PM, Cambiata wrote: