Understand plug-ins

Widgets are used in conjunction with the specific elements, known as plug-ins. Plug-ins enable a widget to invoke API functions, retrieve state information, send and retrieve data from your application and watch for registered actions.

Plug-ins can be used independently, but are usually combined to create functionality:

  • Endpoints – Endpoints allow you to create an adapter to Oracle Commerce REST API functions. For detailed information on creating and working with endpoints, refer to Create an endpoint.
  • Actions – Actions, which are invoked by widgets, send data from your application to the state store, as well as identify any behavior that should occur in response to a change of state. For detailed information on creating and working with actions, refer to Write an action.
  • Fetchers – Before they can be rendered, widgets require that data from many sources be uploaded to the state model. Fetchers, which allow you to identify this data, are functions that use the current store and widget instance configuration values to return a promise. The promise is resolved once the fetcher has completed loading data. Fetchers load data into the state using the store.endpoint method. For detailed information on creating and working with fetchers, refer to Write a fetcher.
  • Subscribers – Subscribers passively watch for registered actions that occur outside of the component. Once an action is recognized, sagas dispatch them. Subscribers do not invoke Redux store actions. They can, however, invoke endpoints independent of the Redux store. Note that subscribers run only on the client. For information on subscribers, refer to Create a subscriber.
  • Helper components – Helper components are any framework module that can be individually referenced. For information on components, refer to Understand helper components.