webos/LS2Request

Provides a class for making LS2 service requests on webOS platforms.

import LS2Request from '@enact/webos/LS2Request';

Members

LS2RequestClass

A class for managing LS2 Requests.

import LS2Request from '@enact/webos/LS2Request';
Constructor
LS2Request()

Create a new LS2 request

Methods
cancel()

Cancel the current LS2 request.

send(options)webos/LS2Request

Send a request to an LS2 service method.

1 Param
options Object

Options for the LS2 Request call

Object keys for options
service String

The name of the LS2 service. Do not include 'luna://'.

method String

The name of the method.

parameters Object

Any parameters required by the service method.

onSuccess Function

The success handler for the request.

onFailure Function

The failure handler for the request.

onComplete Function

The handler to run when the request is completed, regardless of return status.

onTimeout Function

The handler to run when the request times out. Used in conjunction with timeout.

subscribe Boolean

Subscribe to service methods that support subscription.

timeout Number

The delay in milliseconds to wait for the request to return.

ArrayBooleanFunctionModuleNumberObjectString