Download the PHP package icicleio/react-adapter without Composer
On this page you can find all versions of the php package icicleio/react-adapter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download icicleio/react-adapter
More information about icicleio/react-adapter
Files in icicleio/react-adapter
Package react-adapter
Short Description Adapts the event loop and promises of Icicle to interfaces compatible with components built for React.
License MIT
Homepage http://icicle.io
Informations about the package react-adapter
React Adapter for Icicle
This library facilitates interoperability between components built for React and Icicle. This library provides an adapter between the differing event loop and promise implementations of the two libraries.
Requirements
- PHP 5.5+
Installation
The recommended way to install is with the Composer package manager. (See the Composer installation guide for information on installing and using Composer.)
Run the following command to use this library in your project:
You can also manually edit composer.json
to add this library as a project requirement.
ReactLoop
Icicle\ReactAdapter\Loop\ReactLoop
is as a direct replacement for the React event loop. It communicates with the active Icicle event loop to provide the same functionality. The class implements React\EventLoop\LoopInterface
, so it can be used with any component that requires a React event loop.
ReactPromise
Icicle\ReactAdapter\Promise\ReactPromise
creates a promise implementing React\Promise\ExtendedPromiseInterface
and React\Promise\ExtendedPromiseInterface
from an Icicle awaitable that implements Icicle\Awaitable\Awaitable
. This allows awaitables created from Icicle to be used in any component requiring a React promise.
Awaitable\adapt()
The Icicle\Awaitable
namespace defines a function adapt()
that can transform any object with a then(callable $onFulfilled, callable $onRejected)
method into an awaitable implementing Icicle\Awaitable\Awaitable
. This function can be used to convert a React promise to an Icicle awaitable.
See the Awaitable API documentation for more information on Icicle\Awaitable\adapt()
.