Hooks & Events

Hooks & Events

Run logic once a helper is rendered

Define a ready function to run code when a helper instance is initialized and mounted to the HTML:

Fliplet.Helper('profile', {
  data: {
    firstName: 'John'
  },
  ready: function () {
    // Helper has been rendered
  }
});

Run logic once all helpers have been rendered

Define a afterHelpersRender hook to run code when all helpers have been initialized and rendered:

Fliplet.Hooks.on('afterHelpersRender', function () {
  // All helpers have been rendered
});

Further reading

Next article in this series

Styling

Learn more about styling your helpers with CSS.