Labs/Jetpack/JEP/13: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 35: Line 35:
The general syntax for importing from the future is as follows:
The general syntax for importing from the future is as follows:


<pre class="brush:pre;toolbar:false;">jetpack.importFromFuture( stringMountPath )</pre>
<pre class="brush:pre;toolbar:false;">jetpack.future.import( stringMountPath )</pre>


Where <code>stringMountPath</code> is a string that enumerates where, starting from the <code>jetpack</code> base, the feature will be mounted. To get a list of what mount paths are available, see the "Reading the Future" section below. Some examples of using <code>importFromFuture</code> are as folows:
Where <code>stringMountPath</code> is a string that enumerates where, starting from the <code>jetpack</code> base, the feature will be mounted. To get a list of what mount paths are available, see the "Reading the Future" section below. Some examples of using <code>future.import</code> are as folows:


<pre class="brush:js;>
<pre class="brush:js;>
// jetpack.storage.sqlite is currently undefined.
// jetpack.storage.sqlite is currently undefined.
jetpack.importFromFuture("storage.sqlite");
jetpack.future.import("storage.sqlite");
var mydb = jetpack.storage.sqlite.create("blah");
var mydb = jetpack.storage.sqlite.create("blah");


// jetpack.T1000 is currently undefined
// jetpack.T1000 is currently undefined
jetpack.importFromFuture("T1000");
jetpack.future.import("T1000");
jetpack.T1000();
jetpack.T1000();
</pre>
</pre>
Line 59: Line 59:
To determine what features are importable from the future, use:
To determine what features are importable from the future, use:


<pre class="brush:js;toolbar:false;">jetpack.importFromFuture.list()</pre>
<pre class="brush:js;toolbar:false;">var list = jetpack.future.list()</pre>
 
It returns an array containing the set of potential <code>stringMountPoints</code> as used in <code>jetpack.future.import()</code>.
577

edits

Navigation menu