Alias Molecule

Add a Javascript alias.

Summary
Alias Molecule
Preference Dialog
CommentsAliasing is a technique that lets you control the behavior of a group of droplets from one central place.
Properties
typestring, ( r )
pref.namestring, ( r )
pref.pathstring, ( r, w )
aliasstring, ( r, w )
Functions
attach
detach
delete
rename
clone
serialize
apply

Preference Dialog

Comments

Aliasing is a technique that lets you control the behavior of a group of droplets from one central place.  For example, when you create a group of droplets that have similar behavior but different looks and feel, you can place a script molecule on the leader droplet and the others alias molecules pointing to the leader.  When you update the script molecule, all alias molecules are automatically updated as well.

Another useful scenario is to use aliasing to acquire different behavior for a droplet by pointing the alias molecule to different external script molecules during runtime.

Properties

type

string, ( r )

Type of this molecule, alias.

pref.name

string, ( r )

The scriptable name for this molecule.  This name can be set using rename function dynamically.

pref.path

string, ( r, w )

Gets/Sets the path of alias.  Use this to initialize this molecule’s aliasing.  (i.e. app.droplet.aFunctionCall.)

alias

string, ( r, w )

Gets/Sets the path of alias.  Use this to dynamically change this molecule’s aliasing.  (i.e. app.droplet.aFunctionCall.)

Functions

attach

attach(droplet);

Attach this molecule to the given droplet.

Parameters

droplet(object) a droplet.

Returns

N/A

detach

detach();

Remove this molecule from its droplet.

Parameters

N/A

Returns

N/A

delete

delete();

Delete this molecule.

Parameters

N/A

Returns

N/A

rename

rename(name);

Rename this molecule.

Parameters

name(string) a new name.

Returns

N/A

clone

clone();

Create a clone of this molecule.

Parameters

N/A

Returns

(object) a molecule.

serialize

serialize();

Serialize this molecule into its JSON representation.

Parameters

N/A

Returns

(string) JSON representation of a molecule.

apply

apply(params);

Execute the script associated with this alias.

Parameters

params(object) input parameters.

Returns

N/A

Close