UNPKG

entangle.ts

Version:

A declarative, event-driven framework for orchestrating business logic in TypeScript & Node.js applications.

28 lines (27 loc) 872 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HawkingRadiation = void 0; /** * Represents a lazy pointer to data within the EventHorizon. * In our analogy, this is the radiation that "escapes" the horizon, * carrying information about a past event. */ class HawkingRadiation { constructor(queryBuilder) { this.queryBuilder = queryBuilder; } /** * Creates a new pointer to information from the EventHorizon. * @param queryBuilder A configured QueryBuilder instance that specifies which data to fetch. */ static from(queryBuilder) { return new HawkingRadiation(queryBuilder); } /** * Resolves the pointer and retrieves the actual data from the EventHorizon. */ get() { return this.queryBuilder.get(); } } exports.HawkingRadiation = HawkingRadiation;