Pages
    • GETTING STARTED
        • API REFERENCE
                                                                                                                                              • COMMAND LINE
                                                                                                                                                  On this page

                                                                                                                                                      .apply()

                                                                                                                                                      The transaction.apply() method.

                                                                                                                                                      This method is used to apply a new state to the element in a transaction. It is just another way to call the writeCallback function that was used to create the instance.

                                                                                                                                                      Syntax

                                                                                                                                                      transaction.apply(state);

                                                                                                                                                      Parameters

                                                                                                                                                      • state: Object - A new state object that is passed to the instance's writeCallback.

                                                                                                                                                      Return

                                                                                                                                                      • Any - The return value of the transaction's writeCallback function.

                                                                                                                                                      Usage

                                                                                                                                                      Obtain an instance of an ongoing transaction and call .apply(). Below, we build on the usage example on the Transaction page. Here we use the .apply() method to apply the CSS properties in that example.

                                                                                                                                                      ananimationi.apply({
                                                                                                                                                          color: 'brown',
                                                                                                                                                          backgroundColor: 'teal',
                                                                                                                                                      });