These are chat archives for canjs/canjs

18th
Dec 2016
Thomas Sieverding
@Bajix
Dec 18 2016 01:17
It doesn’t seem like can-define-stream is respecting type conversion… is that being skipped or something?
  app: {
    stream: function( setStream ) {
      return setStream.merge(route.data.stream('.app'));
    },
    type: App.Ref.type
  }
That should work no?
Chasen Le Hara
@chasenlehara
Dec 18 2016 01:34
I can’t remember whether the type conversions are supposed to work with stream, so I’ve filed an issue so we can get the answer and document it. canjs/can-define-stream#15
I vaguely remember having this conversation when we first started working on it, but I can’t remember if the decision was to play as well as possible with the other property definitions, or to ignore them.
Justin Meyer
@justinbmeyer
Dec 18 2016 02:05
@Bajix it's not?
what type conversion are you expecting?
type conversion only works on set
so the setStream should be type converted, but not the result of the stream.
Gira Minus
@gKreator
Dec 18 2016 04:05
blob
omfg i misspelled it... lol
:/
Thomas Sieverding
@Bajix
Dec 18 2016 04:08
@justinbmeyer It’s not entirely clear what the data flow for streams is from the documentation. I was thinking that the output of stream would undergo type conversion then call the setter, then getter
I suppose though it would be trivial to map to a type converter
Thomas Sieverding
@Bajix
Dec 18 2016 04:15
Does Can 3 have any documentaion regarding observability of promises
Gira Minus
@gKreator
Dec 18 2016 04:15
^^
I do not think so directly
Thomas Sieverding
@Bajix
Dec 18 2016 04:16
What about lists / can-connect?
Gira Minus
@gKreator
Dec 18 2016 04:35
I think its just standard Promise
Thomas Sieverding
@Bajix
Dec 18 2016 04:40
So can-connect/can/tag/ exposes value/isPending/isResolved to the stache scope tree
Not really seeing where it does that though
It would all kinds of awesome to be able to get that behavior out of any promise
At least that seems like a higher priority w/ jQuery 3.x and the advent of consistent promises
Gira Minus
@gKreator
Dec 18 2016 06:09
You know this better then I do
Otherwise they are both oversvable
Frank Lemanschik
@frank-dspeed
Dec 18 2016 12:55
@Bajix is it something that can be fixed via better documentation?
Thomas Sieverding
@Bajix
Dec 18 2016 19:26
@frank-dspeed Absolutely
Frank Lemanschik
@frank-dspeed
Dec 18 2016 19:37
ok then i understood the issue right did you already create one ?
chason needs to know about that
he is head of don't know what but he is the one who needs to care :)
Thomas Sieverding
@Bajix
Dec 18 2016 19:38
Oh I’ll create one
Frank Lemanschik
@frank-dspeed
Dec 18 2016 19:38
thanks a lot
Dovid Bleier
@dbleier
Dec 18 2016 21:31
I am iterating over an array of strings in my stache template, where I want to 2-way bind the value of each string to an <input> elements, like this:
        {{#each html.externals}}
            <input type="text" {($value)}="." class="externals" /><br/>
        {{/each}}
but the "." is not binding. So what should I use?
Nico R.
@nriesco
Dec 18 2016 21:55
@dbleier what happens if you change the input and use a div or span containing {{.}} ? You can also try using "this"
Dovid Bleier
@dbleier
Dec 18 2016 21:56
@nriesco I want to bind it to the input's dom value, so the user can update it
Gira Minus
@gKreator
Dec 18 2016 21:57
i dont think it works like that?
Are you trying to update the value base on like input change?
Dovid Bleier
@dbleier
Dec 18 2016 21:58
ok, so how to live bind it? I guess worst case, instead of array of strings, could use array of objects containing the string, it's just a bit more messy
Dovid Bleier
@dbleier
Dec 18 2016 21:59
yes, when the user enters a value in the text input, it should update that item in the array
Gira Minus
@gKreator
Dec 18 2016 21:59
yeah you have to use a helper for that
Dovid Bleier
@dbleier
Dec 18 2016 21:59
ah, hmm ok
Gira Minus
@gKreator
Dec 18 2016 22:00
<input type="text" ($change)="updateSomeStuff( %context, %element, %event )" class="externals" /><br/>
Dovid Bleier
@dbleier
Dec 18 2016 22:00
thanks for the feedback
Gira Minus
@gKreator
Dec 18 2016 22:01
then create a helper in the component
updateSomeStuff: function( item, element, event ){ console.log( item() ); }
i think %context gets passed as a constuctor, so you will have to use item() instead of item
Dovid Bleier
@dbleier
Dec 18 2016 22:07
cool, the helper function worked. Thanks a lot!
Gira Minus
@gKreator
Dec 18 2016 22:07
:D