Skip to content

Releases: canjs/can-bind

Adding missing can-log dependency

13 Aug 19:36
Compare
Choose a tag to compare

Bind in domQueue

18 Jul 18:13
Compare
Choose a tag to compare

This enables binding in the DOM queue. This will happen by default if an element is passed:

new Bind({
  parent, child,
  element: element
})

The queue can also be specified:

new Bind({
  parent, child,
  element: element,
  queue: "dom"
})

Tests using canReflect.getName in assertions fail in IE11

05 Jun 21:14
Compare
Choose a tag to compare

Test failed due to canReflect.getName returning a certain value fail in IE11 because of how we name functions differently in IE11. With this fix, the tests use regular expressions to make the assertions less strict.

Issue #24

Warn when a sticky binding is converted on the wrong side.

03 Jun 20:10
Compare
Choose a tag to compare

In a "sticky" two-way binding, one side of the binding should defer to the other for deciding what value the shared object should have. If the wrong side of the binding is changing or converting the value when set, this will cause the values to become desynchronized. With this release, the user is warned in development mode when the non-sticky side changes its value when the binding is started.

Example:

import DefineMap from 'can-define/map/';
import SettableObservable from 'can-simple-observable/settable/';
import Bind from 'can-bind';
var User = DefineMap.extend("User", {
  name: "string"
});
var child = new SettableObservable(val => {
  return val instanceof User ? val : new User(val);
});
var parentMap = new SettableObservable(val => {
 return val instanceof DefineMap ? val : new DefineMap(val);
}, {
  user: {
    name: "Brad"
  }
});

new Bind({
  parent,
  child,
  sticky: "childSticksToParent"
}).start();

The child observable is converting the DefineMap held by the parent to a User object, so on startup the two sides of the observable will not hold the same value. Only the parent should update the value, and a warning will be generated in the console to reflect this.

#23

QUNIT2 upgrade

28 May 17:56
Compare
Choose a tag to compare

This updates the tests to use QUnit@2.x.x.

#20

parent and child properties

24 Feb 23:07
Compare
Choose a tag to compare
const binding = new Bind({
	child: child,
	parent: parent
});
binding.child //-> child 
binding.parent //-> parent

Added onEmit / offEmit to listenAndUpdate methods for emitted values

29 Nov 19:45
Compare
Choose a tag to compare

Allows for the ability to not initialise the parent

27 Nov 20:47
Compare
Choose a tag to compare

speed up tests by not group logging

31 Oct 03:06
Compare
Choose a tag to compare

Log what caused the mutation to change.

31 Oct 02:39
Compare
Choose a tag to compare