Skip to content

Loading external resources #125

@lptr

Description

@lptr

Right now if a module wants to load external resources, it cannot reliable do that. There is a hack that you can write:

require("http://youtube.com/iframe_api", function { /* ... */ })

But doing so makes you implicitly rely on your module being packaged as AMD (i.e. that an async require() function is available in the context). Once you package the module in a Node JS app, it will break. There is already a plan to fix this, but we cannot do that until modules have a better way to access external resources: #122.

Proposal: add a function to the Spaghetti class (nee SpaghettiConfiguration, see #126), so modules can load resources like that. It should look something like this:

function getResource(url:String, onSuccess:Dynamic->Void, onError:Dynamic->Void = null);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions