index.js
function(pathToTarget, target, parserDefinition) {

    var data = this.data;
    var parser = this.parser;
    var animationData;

    // if parse functions were passed in then create a new parser
    if(parserDefinition) {

      parser = new getParser(parserDefinition);
    }

    // if we have a parser then apply the parsers (parsers set css etc)
    if(parser) {

      if(typeof pathToTarget === 'string') {

        pathToTarget = pathToTarget.split('.');
      }

      animationData = data[ pathToTarget[ 0 ] ];

      for(var i = 1, len = pathToTarget.length; i < len; i++) {

        animationData = animationData[ pathToTarget[ i ] ];
      }

      parser.update(target, animationData);
    }
  }
function(pathToTarget, target, parserDefinition) {

    var data = this.data;
    var parser = this.parser;
    var animationData;

    // if parse functions were passed in then create a new parser
    if(parserDefinition) {

      parser = new getParser(parserDefinition);
    }

    // if we have a parser then apply the parsers (parsers set css etc)
    if(parser) {

      if(typeof pathToTarget === 'string') {

        pathToTarget = pathToTarget.split('.');
      }

      animationData = data[ pathToTarget[ 0 ] ];

      for(var i = 1, len = pathToTarget.length; i < len; i++) {

        animationData = animationData[ pathToTarget[ i ] ];
      }

      parser.update(target, animationData);
    }
  }
function ( pathToTarget , target , parserDefinition ) { var data = this . data ; var parser = this . parser ; var animationData ; // if parse functions were passed in then create a new parser if ( parserDefinition ) { parser = new getParser ( parserDefinition ) ; } // if we have a parser then apply the parsers (parsers set css etc) if ( parser ) { if ( typeof pathToTarget === 'string' ) { pathToTarget = pathToTarget . split ( '.' ) ; } animationData = data [ pathToTarget [ 0 ] ] ; for ( var i = 1 , len = pathToTarget . length ; i < len ; i ++ ) { animationData = animationData [ pathToTarget [ i ] ] ; } parser . update ( target , animationData ) ; } }
An advanced method where you can apply the current state f1
has calculated to any object.

Basically allows you to have one f1 object control multiple objects
or manually apply animations to objects.

@param  {String} pathToTarget A path in the current state to the object you'd like to apply. The path should
be defined using dot notation. So if your state had an object named `thing` and it
contained another object you'd like to apply called `data`. Your `pathToTarget`
would be `'thing.data'`
@param  {Object} target The object you'd like to apply the currently calculated state to. For instance target
could be an html element.
@param  {Object} [parserDefinition] An optional Object which defines init and update functions for a parser.
An advanced method where you can apply the current state f1 has calculated to any object .