These are chat archives for canjs/canjs

7th
Jul 2017
Viktor Busko
@Lighttree
Jul 07 2017 06:16
@matthewp yes, they added P0 for it. So I guess this will be fixed in nearest future.
webpack/webpack#5198
As temporary solution I just created 'shimmed' copy of can-fixture.js locally in order to fix the build.
Viktor Busko
@Lighttree
Jul 07 2017 06:26
Guys, for this feature:
https://canjs.com/doc/can-view-import.html
There is a line in docs
Currently this only works with can-view-autorender or the steal-stache plugin.
Does this mean that there is a plan to provide this feature for cases when you build using something different from Steal ?
Frank Lemanschik
@frank-dspeed
Jul 07 2017 09:09
@mihmul83 what your doing there looks really wirred :) it looks for me like Express
or some other NodeJs framework that is similar
app === express() ?
this is canJS's router module
@Lighttree this because of donejs/donejs
its steal + donejs
and it works and is used also with done-autorender
wich is used there
in donejs this is the strandart method of importing stuff via stache
there you can see the dynamic imports
Justin Meyer
@justinbmeyer
Jul 07 2017 15:32
Matthew Phillips
@matthewp
Jul 07 2017 15:33
@Lighttree I saw they merged the webpack bug, did you try again?
Frank Lemanschik
@frank-dspeed
Jul 07 2017 16:18
@justinbmeyer about debug of kefir streams i use scan for this already you can simply scan and see the values where they come from isn't that enought?
Frank Lemanschik
@frank-dspeed
Jul 07 2017 16:52
@justinbmeyer do you think it is possible to maybe work with me or some one else on can-event that it some how could drive values from events like a socket.io event emitter into define map for me it looks like this could get compatible some way and shouldn't be so much work? or are there pitfalls?
Justin Meyer
@justinbmeyer
Jul 07 2017 18:29
@frank-dspeed derivedStream.scan won't be able to give me the stream that derivedStream is deriving from
I'm not sure what you mean by "drive values from events"
Frank Lemanschik
@frank-dspeed
Jul 07 2017 18:30
i mean i saw some packages like can-event
that look like they could create a compute that sets its value from a event
was that wrong?
i need a CanJS Compatible observable from an eventEmitter like socket.io
so that the computes value is message for example from socket.on('msg', message)
a define map is a object full of observeables right?
var handlers = [];
var value;
    var fn = function(){
        Observation.add(fn);
        return value;
    };
        socket.on('msg', function(data){
                           value = data;
                        handlers.forEach(function(handler){
                canBatch.queue([handler, fn, [newValue]]);
            }, this);
         })

    CID(fn);
    canReflect.set(fn, canSymbol.for("can.onValue"), function(handler){
        handlers.push(handler);
    });
    canReflect.set(fn, canSymbol.for("can.offValue"), function(handler){
        var index = handlers.indexOf(handler);
        handlers.splice(index, 1);
    });
    return fn;
ask this in a forum post and I can go into more detail
Frank Lemanschik
@frank-dspeed
Jul 07 2017 18:36
ok i will do that but i think i already getting it
i think i understand this a bit i will create a post about that thanks a lot
maybe this will also allow me to use streams finally as expect
that all would be the awsome bridge i needed all the time