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

[CLEANUP beta] Remove Ember.oneWay. #11914

Merged
merged 1 commit into from
Jul 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions packages/ember-metal/lib/binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,21 +466,6 @@ export function bind(obj, to, from) {
return new Binding(to, from).connect(obj);
}

/**
@method oneWay
@for Ember
@param {Object} obj The root object of the transform.
@param {String} to The path to the 'to' side of the binding.
Must be relative to obj.
@param {String} from The path to the 'from' side of the binding.
Must be relative to obj or a global path.
@return {Ember.Binding} binding instance
@public
*/
export function oneWay(obj, to, from) {
return new Binding(to, from).oneWay().connect(obj);
}

export {
Binding,
isGlobalPath
Expand Down
4 changes: 1 addition & 3 deletions packages/ember-metal/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ import {
import {
Binding,
bind,
isGlobalPath,
oneWay
isGlobalPath
} from 'ember-metal/binding';
import run from 'ember-metal/run_loop';
import Libraries from 'ember-metal/libraries';
Expand Down Expand Up @@ -309,7 +308,6 @@ Ember.immediateObserver = _immediateObserver;
Ember.mixin = mixin;
Ember.Mixin = Mixin;

Ember.oneWay = oneWay;
Ember.bind = bind;
Ember.Binding = Binding;
Ember.isGlobalPath = isGlobalPath;
Expand Down
44 changes: 0 additions & 44 deletions packages/ember-metal/tests/binding/one_way_test.js

This file was deleted.

37 changes: 1 addition & 36 deletions packages/ember-runtime/tests/legacy_1x/system/binding_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Ember from 'ember-metal/core';
import {get} from 'ember-metal/property_get';
import {set} from 'ember-metal/property_set';
import run from 'ember-metal/run_loop';
import {Binding, bind, oneWay} from 'ember-metal/binding';
import {Binding, bind } from 'ember-metal/binding';
import {observer as emberObserver} from 'ember-metal/mixin';
import EmberObject from 'ember-runtime/system/object';

Expand Down Expand Up @@ -120,41 +120,6 @@ QUnit.test('binding disconnection actually works', function() {
equal(get(toObject, 'value'), 'start');
});

// ..........................................................
// one way binding
//

QUnit.module('one way binding', {

setup() {
run(function() {
fromObject = EmberObject.create({ value: 'start' });
toObject = EmberObject.create({ value: 'end' });
root = { fromObject: fromObject, toObject: toObject };
binding = oneWay(root, 'toObject.value', 'fromObject.value');
});
},
teardown() {
run.cancelTimers();
}
});

QUnit.test('fromObject change should propagate after flush', function() {
run(function() {
set(fromObject, 'value', 'change');
equal(get(toObject, 'value'), 'start');
});
equal(get(toObject, 'value'), 'change');
});

QUnit.test('toObject change should NOT propagate', function() {
run(function() {
set(toObject, 'value', 'change');
equal(get(fromObject, 'value'), 'start');
});
equal(get(fromObject, 'value'), 'start');
});

var first, second, third, binding1, binding2; // global variables

// ..........................................................
Expand Down