import { Observable , merge } 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 class Pin extends Connectible { param observable protected isLocked ( observable ) { return observable !== undefined ; } param _ param observable protected shouldResolve ( _ , observable ) { return observable === undefined ; } param inbound protected resolve ( inbound ) { return ( inbound . length == 1 ) ? inbound [ 0 ] . observable : merge ( ... inbound . map ( pin => pin . observable ) ) ; } } /**
 *
 * Creates a typical [pin](https://connective.dev/docs/pin) object.
 * [Checkout the docs](https://connective.dev/docs/pin) for examples and further information.
 *
 */ export function pin ( ) { return new Pin ( ) ; } export default pin ;