Registry

Spirit keeps track of existing groups on your web page. All groups listed in this registry are automatically traceable by the Spirit desktop application.

Loading animation groups via spirit.create() or spirit.load() will add the groups to the registry by default.

API

import { groups } from 'spiritjs'

/**
* List of all groups
*
* @type {Array}
*/
groups.list

/**
* Iterate over each group
*
* @type {Function}
*/
groups.each(group => { })

/**
* Get all group names
*
* @returns {Array}
*/
groups.groupNames()

/**
* Get group by name
*
* @param   {string}
* @returns {spirit.Group}
*/
groups.get('hamburger')

/**
* Get group by index
*
* @param   {number}
* @returns {spirit.Group}
*/
groups.at(0)

/**
* Add new group
*
* @type {Function}
*/
groups.add(group)

/**
* Removes group
*
* @type {Function}
*/
groups.remove(group)

/**
* Construct all groups
*
* @type {Function}
*/
groups.construct()

// listen for events
groups.on('add', group => {})
groups.on('remove', group => {})
groups.on('change:list', list => {})

Work in progress!

More detailed documentation is coming soon

results matching ""

    No results matching ""