@wirelineio/appkit

0.3.0 • Public • Published

appkit

SDK for the development of Web and mobile applications and pads.

withLogView

import { withLogView } from '@wirelineio/appkit';

withLogView({ view, options })(Component);

withLogView HOC provides access to the underlying view. It retrieves item data and subscribes for changes and updates based on the supplied variables.

  • view: {String} The view name. Required.
  • options: {Function(props) => ({ variables: { id } })} Map props or external varibles to return an object with the form of { variables: { id } } where id is the desired itemId. Required.

The Component receives then a property view with the following properties:

  • itemId: {String} The item ID.
  • title: {String} Title.
  • type: {String} The item type.
  • appendChange: {Function(Any)} Function to append a change in the log.
  • log: {Any[]} Array of
  • content: {String} Flat string of changes.
  • update: {Function({title, type})} Updater function for title and type.
  • archive: {Function} Archive this item.
  • unarchive: {Function} Unarchive this item.

Readme

Keywords

none

Package Sidebar

Install

npm i @wirelineio/appkit

Weekly Downloads

0

Version

0.3.0

License

GPL-3.0

Unpacked Size

82 kB

Total Files

10

Last publish

Collaborators

  • dboreham
  • telackey
  • egorgripasov
  • richburdon
  • ashwinp