HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/quadcode-jobs/node_modules/rx/ts/core/observer-extras.ts
/// <reference path="./disposables/disposable.ts" />
/// <reference path="./checkedobserver.ts" />
/// <reference path="./notification.ts" />
module Rx {
	export interface Observer<T> {
        /**
        *  Creates a notification callback from an observer.
        * @returns The action that forwards its input notification to the underlying observer.
        */
		toNotifier(): (notification: Notification<T>) => void;

        /**
        *  Hides the identity of an observer.
        * @returns An observer that hides the identity of the specified observer.
        */
		asObserver(): Observer<T>;

        /**
        *  Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods.
        *  If a violation is detected, an Error is thrown from the offending observer method call.
        * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer.
        */
        checked(): CheckedObserver<T>;

        /**
        * Schedules the invocation of observer methods on the given scheduler.
        * @param {Scheduler} scheduler Scheduler to schedule observer messages on.
        * @returns {Observer} Observer whose messages are scheduled on the given scheduler.
        */
        notifyOn(scheduler: IScheduler): Observer<T>;
	}

	export interface ObserverStatic {
        /**
        *  Creates an observer from a notification callback.
        *
        * @static
        * @memberOf Observer
        * @param {Function} handler Action that handles a notification.
        * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
        */
		fromNotifier<T>(handler: (notification: Notification<T>, thisArg?: any) => void): Observer<T>;
	}
}


(function() {
    var observer: Rx.Observer<boolean>;
    var n: (notification: Rx.Notification<boolean>) => void = observer.toNotifier();

    var o: Rx.Observer<boolean> = observer.asObserver();

    var c: Rx.CheckedObserver<boolean> = observer.checked();

    o = observer.notifyOn(Rx.Scheduler.immediate);

    var so : Rx.Observer<number> = Rx.Observer.fromNotifier<number>((n) => {
        // Handle next calls
        if (n.kind === 'N') {
            console.log('Next: ' + n.value);
        }

        // Handle error calls
        if (n.kind === 'E') {
            console.log('Error: ' + n.exception);
        }

        // Handle completed
        if (n.kind === 'C') {
            console.log('Completed')
        }
    });
});