Files
talk/docs/source/api/client.md
T
2018-07-13 16:19:00 +00:00

5.3 KiB
Raw Blame History

title, permalink, toc, class
title permalink toc class
Client Plugin API /api/client/ true configuration

We created a set of utilities to make it easier to create and add functionality to plugins. Feel free to check all the utilities here: talk/plugin-api.

Actions

Admin

  • viewUserDetail

Auth

  • setAuthToken
  • handleSuccessfulLogin
  • logout

Notification

  • notify

Stream

  • setSort
  • showSignInDialog

Import

import {notify} 'plugin-api/beta/actions';

Usage

// Trigger a notification
notify('success', t('suspenduser.notify_suspend_until', username, timeago(until))

// mapDispatchToProps
const mapDispatchToProps = dispatch => ({
  ...bindActionCreators(
    {
      notify,
    },
    dispatch
  ),
});

Components

  • Slot You probably wont need to use the <Slot/> component in your plugin. But theres a chance you might want to add a Slot so another plugin gets injected in your plugin.

Props

  • fill : <String | Array> Name of the slot
  • defaultComponent : <Element | Array> The default component if no plugin component is provided to the Slot
  • size : <Number | Array> - How many components this Slot should show - Slot size or an Array of slot size
  • passthrough: