Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dlghq/dialog-utils

Package Overview
Dependencies
Maintainers
32
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dlghq/dialog-utils

A collection of utility libraries used by Dialog projects.

  • 0.10.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
32
Created
Source

Dialog JavaScript utils

A collection of utility libraries used by Dialog projects.

Installation

npm install --save @dlghq/dialog-utils

Usage

import { isElectron } from '@dlghq/dialog-utils';

console.log('isElectron: ', isElectron());

Redux

import { Field } from '@dlghq/dialog-utils';

Field.create({ value: '' })
  .map((value) => 'foo')
  .flatMap((value, error, pending) => new Field(value, error, true))
  .render((value, error, pending) => (
    <FieldView value={value} pending={pending} />
  ));

function addContact(uid: number) {
  return ({ dispatch, messenger }) => {
    Field.dispatch({
      dispatch,
      type: '@@dialog/USER_CONTACT_ADD',
      context: uid,
      action: messenger.contacts.add(uid),
      initialState: null,
    });
  };
}

dispatch(addContact(123));
// { type: '@@dialog/USER_CONTACT_ADD', payload: { value: null, error: null, pending: true }, meta: { context: 123 } }
// then
// { type: '@@dialog/USER_CONTACT_ADD', payload: { value: <response>, error: null, pending: false }, meta: { context: 123 } }
// or
// { type: '@@dialog/USER_CONTACT_ADD', payload: { value: null, error: <error>, pending: false }, meta: { context: 123 } }

License

Apache-2.0

FAQs

Package last updated on 16 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc