public static <E> ScopeProvider from(final LifecycleProvider<E> provider, final E event) {
    return () -> provider.lifecycle().compose(provider.bindUntilEvent(event)).ignoreElements();
  }
public static < E > ScopeProvider from ( final LifecycleProvider < E > provider , final E event ) { return ( ) -> provider . lifecycle ( ) . compose ( provider . bindUntilEvent ( event ) ) . ignoreElements ( ) ; }
Factory creating a {@link ScopeProvider} representation of a {@link LifecycleProvider}.

<p>Example usage:

<pre><code>
Observable.just(1)
.as(autoDisposable(RxLifecycleInterop.from(lifecycleProvider, event)))
.subscribe(...)
</code></pre>

@param <E> the lifecycle event.
@param provider the {@link LifecycleProvider}.
@param event a target event to dispose upon.
@return a {@link ScopeProvider}