These are chat archives for canjs/canjs

20th
Dec 2016
Kevin Phillips
@phillipskevin
Dec 20 2016 00:59
@georgesunil81 not sure if you saw, but there is https://github.com/canjs/can-connect-signalr
arti1793
@arti1793
Dec 20 2016 08:37
hi! how can i bind multiple functions on click event using new binding syntax?
Gira Minus
@gKreator
Dec 20 2016 08:39
Easiest route is to call two functions on the single function
Ive been wondering about this nyself honestly
Otherwise try it
arti1793
@arti1793
Dec 20 2016 08:43
it'd be more comfortable just to call ($click)="[func1('arg' ,'-1'),finc2('true')]" or smth like this
Gira Minus
@gKreator
Dec 20 2016 08:44
Yeah can you try having two ($click)=act1 ()"
arti1793
@arti1793
Dec 20 2016 08:45
it binds only the last function
Gira Minus
@gKreator
Dec 20 2016 08:46
Did you try ($click)="act1 (),act2 ()"
arti1793
@arti1793
Dec 20 2016 08:47
binds only the first func :D
Gira Minus
@gKreator
Dec 20 2016 08:48
Lolol
arti1793
@arti1793
Dec 20 2016 08:49
older versions have same behaviour with can-click
Gira Minus
@gKreator
Dec 20 2016 08:49
Yeah well... you could use an { event: {}} instead
Yesh i never tried this but i have always wondered
Anyway, make it an issue on git
arti1793
@arti1793
Dec 20 2016 08:51
{ event: {}} ? how?
arti1793
@arti1793
Dec 20 2016 08:59
i'll better just make an function wrapper
Gira Minus
@gKreator
Dec 20 2016 08:59
Yup
arti1793
@arti1793
Dec 20 2016 09:00
thanks
Thomas Sieverding
@Bajix
Dec 20 2016 09:00
@arti1793 You can use call expressions
Something like($click)=“submit(model.save())”
arti1793
@arti1793
Dec 20 2016 09:06
@Bajix such a hack ahah but it works. thanks
Thomas Sieverding
@Bajix
Dec 20 2016 09:06
Why’s that a hack?
What’s your use case btw
Gira Minus
@gKreator
Dec 20 2016 09:07
It seems odd
He just eants
arti1793
@arti1793
Dec 20 2016 09:07
($click)="inc(this,'box_quantity' ,'-1',setUncomittedChanges('true'))"
it really looks odd
Gira Minus
@gKreator
Dec 20 2016 09:08
Two click events on one element
Thomas Sieverding
@Bajix
Dec 20 2016 09:08
So that’s maybe a bad use case for what you’re doing
Check out can-define-stream
What you’re really looking for is side-effects
arti1793
@arti1793
Dec 20 2016 09:09
thanks i'll check it out, but i use 2.3
Thomas Sieverding
@Bajix
Dec 20 2016 09:09
Make the upgrade. It’s all kinds of awesome
Gira Minus
@gKreator
Dec 20 2016 09:10
Yup
Thomas Sieverding
@Bajix
Dec 20 2016 09:10
This is basically the most exciting CanJS release ever
Literally has all the things
It’s like Magnum Opus status
arti1793
@arti1793
Dec 20 2016 09:12
i'm afraid of backward compatibility honestly
should do some refactoring before, i think
Thomas Sieverding
@Bajix
Dec 20 2016 09:13
IMO backwards compatibility should be a complete non-consideration
3.0 switches to semantic versioning / split up packages
arti1793
@arti1793
Dec 20 2016 09:14
okay, thanks. i'll check it out
Chasen Le Hara
@chasenlehara
Dec 20 2016 18:30
@arti1793, please check out our migration guide: http://canjs.com/doc/migrate-3.html
We’re continuously improving it too, so if there’s something that’s unclear, please mention it here or create an issue. 😊
Frank Lemanschik
@frank-dspeed
Dec 20 2016 21:02
you all should prepare for react can-connect fixes :) i need to join 2 react projects using can connect into a new one :) hope that parts are working
hehehehehe
Thomas Sieverding
@Bajix
Dec 20 2016 23:30
Is there a way to get DefineMap __keys ?
Or like a list of all serializeable keys
Kevin Phillips
@phillipskevin
Dec 20 2016 23:36
Object.keys(myDefineMap.get()) ?
Thomas Sieverding
@Bajix
Dec 20 2016 23:37
I was looking more so for a list of all defined serializable properties that could come into existence, presuming it’s sealed
Having issues with the __keys event when using can-stream
this.stream(‘__keys’) doesn’t work :(
Stream.toStreamFromEvent(model, '__keys')
Kevin Phillips
@phillipskevin
Dec 20 2016 23:39
what happens with this.stream(‘__keys’)?
Thomas Sieverding
@Bajix
Dec 20 2016 23:41
this.stream(‘.__keys’) returns undefined and this.stream(‘__keys’) isn’t being called, even when I set new props
That’s basically only called with unsealed DefineMap’s that’re setting props on keys that don’t have definitions
Kevin Phillips
@phillipskevin
Dec 20 2016 23:44
ok, so for sealed DefineMaps, are you looking for _define.definitions ?
Thomas Sieverding
@Bajix
Dec 20 2016 23:44
I guess this.serialize will trap all applicable key
Kevin Phillips
@phillipskevin
Dec 20 2016 23:45
or a subset of those that are serializable I guess
Thomas Sieverding
@Bajix
Dec 20 2016 23:46
I don’t think the functions that I’d want to recycle are lexically exposed
Kevin Phillips
@phillipskevin
Dec 20 2016 23:46
not sure what you mean
what are you trying to recycle?
Thomas Sieverding
@Bajix
Dec 20 2016 23:47
So there’s behavior in serialize that could be abstracted to get a list of keys for serializable props
Having that separate would be useful for more complex streams
My use case here is basically to use change streams to reset combined validation streams on props that are being modified
Kevin Phillips
@phillipskevin
Dec 20 2016 23:48
ok
yeah, I think creating a stream from the serialized map would work
Thomas Sieverding
@Bajix
Dec 20 2016 23:49
So if there was an easy way to get those keys, then it would simplify making the stream pool
Kevin Phillips
@phillipskevin
Dec 20 2016 23:50
you’re basically trying to get a “change” event
Thomas Sieverding
@Bajix
Dec 20 2016 23:50
Actually an event type stream, but yea
Kevin Phillips
@phillipskevin
Dec 20 2016 23:51
yeah, so create a derived property that is the serialized value
and create a stream from that
Thomas Sieverding
@Bajix
Dec 20 2016 23:51
I think I can use a deep-equals filter predicate with a compute stream of the serialized keys then flatmap into individual propery streams
But man, we should really add in some helpers into the DefineMap prototype
Kevin Phillips
@phillipskevin
Dec 20 2016 23:52
:+1: