UNPKG

@connectv/core

Version:

agent-based reactive programming library for typescript/javascript

52 lines (51 loc) 1.64 kB
import { Observable } from 'rxjs'; import { Emission } from '../shared/emission'; import { PinLike } from './pin-like'; import { Connectible } from './connectible'; /** * * Represents the basic [pin](https://connective.dev/docs/pin) object. * This pin type gets locked when its observable is realized, * will resolve only when its observable is not realized and its resolution * will be merged observable of all of the incoming pins' observables. * */ export declare class Pin extends Connectible { /** * * Determines if this pin is locked, based on whether or not its underlying * observable has been resolved or not. * * @param observable * */ protected isLocked(observable: Observable<Emission> | undefined): boolean; /** * * Determines whether this pin should resolve its underlying observable, * based on whether or not its underlying observable has been resolved or not. * * @param _ * @param observable * */ protected shouldResolve(_: PinLike[], observable: Observable<Emission> | undefined): boolean; /** * * Resolves its underlying observable, by * [mergeing](https://rxjs-dev.firebaseapp.com/api/index/function/merge) * corresponding observables of inbound pins. * * @param inbound * */ protected resolve(inbound: PinLike[]): Observable<Emission>; } /** * * Creates a typical [pin](https://connective.dev/docs/pin) object. * [Checkout the docs](https://connective.dev/docs/pin) for examples and further information. * */ export declare function pin(): Pin; export default pin;