Skip to main content

ensemble.Data

ensemble#

ensemble~Data#

Data is a multi-purpose utility object.

It could be used as a wrapper around a Compo composition, this object can store any kind of properties.

Kind: inner class of ensemble

new Data(ns, obj)#

Constructor method.

ParamTypeDescription
nsstringData namespace
objobjectA starter Object

Example

new ensemble.Data('namespace-of-my-foo-component', { compo: ensemble.Compo, foo: 'a text string', fooObj: 'an object' });

data._Symbol.toStringTag โ‡’ string#

Getter for Symbol property, returns the symbolic name for ensemble.Data class.

Kind: instance property of Data
See: Symbol.toStringTag
Todo

  • return undef
  • backward compatibility

data.compo(tag, name, props, defer, fresh, stale) โ‡’ mixed#

The compo method is a utility render.

When you create a composition with this method, it will create a Compo composition or simply an Object placeholder. With the defer render you can have it rendered in place, refresh, or freeze.

Kind: instance method of Data
Returns: mixed - compo - An ensemble.Compo element -or- an Object placeholder

ParamTypeDefaultDescription
tagstringElement node tag -or- component name
namestring
propsobjectProperties for Element node -or- component
deferbooleanfalseDefer render for composition
freshmixedfalseA function callback, called when is loaded the compo
stalemixedfalseA function callback, called when is unloaded the compo

data.render(slot)#

Renderizes a composition, passed by reference.

Kind: instance method of Data

ParamTypeDescription
slotmixedReference of the element that will be rendered

data.stale(slot)#

Freezes a composition, passed by reference.

Kind: instance method of Data

ParamTypeDescription
slotmixedReference of the element that will be rendered

data.reflow(slot, force)#

Refresh a composition, passed by reference.

Kind: instance method of Data

ParamTypeDescription
slotmixedReference of the element that will be rendered.
forcebooleanIt forces the reflow.

Data.isData() โ‡’ boolean#

Check if passed object is an ensemble.Data instance.

Kind: static method of Data
Todo

  • backward compatibility