Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing behavior of interval function #221

Open
ehsanhrz opened this issue Mar 17, 2024 · 0 comments
Open

changing behavior of interval function #221

ehsanhrz opened this issue Mar 17, 2024 · 0 comments

Comments

@ehsanhrz
Copy link

ehsanhrz commented Mar 17, 2024

i created a new observable by extending AbstractObservable . later on, i tried interval operation on the new object but this operation ignores the behavior of my own object and returns IntervalObservable. this makes my own functionality obsolete and makes it useless. I'm suggesting to change the behavior of the operator ; to don't return a IntervalObservable if i calling this method from my own observable . i think we can do this by defining new parameter to the operator witch is null able. this new parameter defines the type of the observable that i want to return. or we can change the functionality of the operator by defining new way. in this new way the interval operation wont return new different object .rather it modifies the behavior of the subscribe function itself .

class Observable extends RxObservable
{
    
    public function AA(): void
    {
        printf("i'm AA coming from observable object\n");
    }

    public function BB(): void
    {
        printf("i'm BB coming from observable object\n");
    }

    public function CC(): void
    {
        printf("i'm CC coming from observable object\n");
    }

    protected function _subscribe(ObserverInterface $observer): DisposableInterface
    {
        
        try
        {
            
            $this->AA();
            $this->BB();
            $this->CC();
            $observer->onNext("call the completed function\n");
            $observer->onCompleted();
            $disposable = new EmptyDisposable();
            return $disposable;
        }
        catch(Exception $e)
        {
            printf("this is the error: ".$e);
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant