Home Reference Source
import RemotePromise from 'remote-context/lib/RemotePromise.js'
public class | source

RemotePromise

Example:

const promise = new RemotePromise(remoteSession, action);

// resolve the action value
promise.then(value => {
  // `value` is the resolve remote action value
});

// resolve property of the action value
promise.find().then(value => {
  // `value` === resolveOnRemote(action.fetch().find())
});

Constructor Summary

Public Constructor
public

constructor(session: RemoteSession, action: Action, opts: object): function

Create a remote promise from a given action.

Public Constructors

public constructor(session: RemoteSession, action: Action, opts: object): function source

Create a remote promise from a given action.

Params:

NameTypeAttributeDescription
session RemoteSession

The remote session

action Action

The given action

opts object
  • optional

Session#request options

Return:

function

The remote promise