Wednesday, 15 June 2011

javascript - bacon.js Bus.plug: Uncaught Error: not an Observable : [object Object] -


I was trying to make a back-up tutorial.

However, I got an error in "just. Plugging"

  var cart = shoppingcart ([]) var cartview = shoppingcartview (cart.contentProperty) var newItemView = NewItemView ( ) Cart.addBus.plug (newItemView.newItemStream)  

Error:

  Uncheck error: No an overview: [object object] shopBundle.js: 145 AssertObservable shopBundle.js: 2650 bus.plug  

I use this type of

  • baconjs@0.7.53
  • jquery @ 2.13
  • Bacon-jquery-bindings@0.2.8
  • WebPack 1.7.3

What am I doing wrong? Thank you.


Edit: 2015/3/25

Because it is that the newItemView.newItemStream is not viewable.
( newItemView.newItemStream instanceofBacon.Observable

and newItemView.newItemStream is EventStream

  EventStream {takeUntil: function, sample by: function, combine: function , FlatMapLatest: function, fold: function ...}  

Is not all the event stream an observable?

NewestSTream has been created:

  var $ button = $ ('# addButton'); Var $ nameField = $ ('# nameText'); Var newItemProperty = Bacon $. TextFieldValue ($ nameField) ); Var newItemClick = $ button.asEventStream ('click'); var newItemStream = newItemProperty.sampledBy (newItemClick);  

This is the first time the question is when I was missed.

/ * And, I try a more simple code. This is the only error. /

< Pre> var someStream = Bacon.interval (1000) .map (function () {new date (). GetTime ();}); var bus = new bacon. Bus (); bus.log (); Bus.plug (someStream);

This is caused by "bacon-jquery-bindings" ()

  Var requires bacon = ('bacon'); Var $ = jQuery = Requirement ("jquery"); Bacon $ = Is required ("Bacon-Jacqui-Binding"); 


No comments:

Post a Comment