blob: b06fb5849adc1973422f504f58f073721174eb4d [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package io.v.baku.toolkit.bind;
import io.v.rx.syncbase.SingleWatchEvent;
import rx.Observable;
import rx.Subscription;
/**
* This interface represents a bidirectional data binding between a Syncbase row and an Android
* widget. Bindings are nested from the Syncbase layer innermost to the UI layer outermost. The
* downlink is the data flow from Syncbase to the UI, and the uplink is the data flow from the UI to
* Syncbase.
*/
public interface TwoWayBinding<T> {
/**
* Links the data flow from Syncbase to the UI. This method should be called at most once per
* instance, and the observable should have at most one subscriber.
*/
Observable<SingleWatchEvent<T>> downlink();
/**
* Links the data flow from the UI to Syncbase. This method should be called at most once per
* instance, and the observable should have at most one subscriber.
*/
Subscription uplink(Observable<T> rxData);
}