Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 18 22:20
    greenkeeper[bot] labeled #5391
  • Oct 18 22:20
    greenkeeper[bot] opened #5391
  • Oct 18 22:20

    greenkeeper[bot] on can-observable-mixin-1.0.3

    fix(package): update can-observ… (compare)

  • Oct 18 19:08
    cherifGsoul labeled #5390
  • Oct 18 19:07
    cherifGsoul opened #5390
  • Oct 18 18:45
    greenkeeper[bot] labeled #5389
  • Oct 18 18:45
    greenkeeper[bot] opened #5389
  • Oct 18 18:45

    greenkeeper[bot] on can-observable-bindings-1.3.0

    fix(package): update can-observ… (compare)

  • Oct 18 18:29

    matthewp on master

    Update dist for release (compare)

  • Oct 18 18:29

    matthewp on v6.1.3

    Update dist for release 6.1.3 (compare)

  • Oct 18 17:59

    matthewp on can-observable-array-1.0.2

    (compare)

  • Oct 18 17:59

    matthewp on master

    fix(package): update can-observ… Merge pull request #5388 from c… (compare)

  • Oct 18 17:59
    matthewp closed #5388
  • Oct 18 16:46
    greenkeeper[bot] labeled #5388
  • Oct 18 16:46
    greenkeeper[bot] opened #5388
  • Oct 18 16:46

    greenkeeper[bot] on can-observable-array-1.0.2

    fix(package): update can-observ… (compare)

  • Oct 18 12:45
    greenkeeper[bot] labeled #5387
  • Oct 18 12:45
    greenkeeper[bot] opened #5387
  • Oct 18 12:45

    greenkeeper[bot] on can-stache-element-1.0.2

    fix(package): update can-stache… (compare)

  • Oct 18 09:49
    chasenlehara edited #5384
Frank Lemanschik
@frank-dspeed
via the stache template
{{#if listArtist.isResolved}}
    <div  on:inserted="initGallery()" class="justified-gallery justifiedGallery" id="puppies">
        {{#listArtist.value}}
        <!-- https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQN8oh9a91sQGeOjg7DwZFAaecnWnLlUoVEREk-yDlbr75vcbHG  on:click="doSomething(%element)"-->

          <div id="{{_id}}">
            <a  href="{{routeUrl ( page='details'  )}}&artistId={{_id}}"><img alt="{{name}}" data-artist-id="{{_id}}"  src="http://master.peep:3030/bilder/{{_id}}/{{mainImage}}" /></a>
          </div>

        {{/listArtist.value}}
        <br />
    </div>
    <a href="{{routeUrl ( page='session' )}}"><button style="width: 100%;" class="btn btn-success">BUCHUNG ABSCHLIESSEN</button></a>
    {{/if}}
look at the on:inserted
this is for example one easy way to fire a function after data is Resolved
Frank Lemanschik
@frank-dspeed
but if your a current canjs user you need to import something to make this on:inserted work again
as far as i remember

@kaderiho can you describe more about your problem? I'm not sure I understand it. Component's templates are rendered immediately. So I'm not sure what you mean by:

template is rendered with some delay

Matthew Phillips
@matthewp
Please fill out the community survey! https://www.surveymonkey.com/r/donejs-survey-8
qantourisc
@qantourisc
Where to unlisten to event to prevent memory leaks ?
Kevin Phillips
@phillipskevin
how are you listening to the event, @qantourisc ?
RanjanSubbiah-tc
@RanjanSubbiah-tc
hey guys, Is it possible to do live-bindings using can-slot? https://canjs.com/doc/can-component/can-slot.html
{{#each ./slides}}

        <can-slot name="nameOfImage" isActiveYes:from="../isActive(scope.index)"/>

        <content />

{{/each}}

<can-template name="nameOfImage">

        <div
            class="slide photosSlide {{#if ./isActiveYes}} active {{/if}}"
            tabindex="{{#if ./isActiveYes}} 0 {{else}} -1 {{/if}}"
        >
               </div>
</can-template>
it's not working when I implement it like above
qantourisc
@qantourisc
@phillipskevin Mostly binding on defineMaps. The app is leaking, but I am not sure where from :(
Kevin Phillips
@phillipskevin
how are you doing the binding though?
qantourisc
@qantourisc
o let me check
I have a few: let compute = can.compute( serialize() ).on("change",func) and a few this.on("field",func); or did you mean something else ?
I also have some "recrusive" bindings, or is there a better way to do it ? I wish to listen to myDefineMapInstance.member.submember. But member might not be defined yet.
Kevin Phillips
@phillipskevin
so for the first ones, you basically need to call off
each this.on("field",func); should have a matching this.off("field",func);
qantourisc
@qantourisc
I'd be happy to. I was quite literal in my initial question though: where/when ? I'd be happy to cleanup, but I need some hook for when things "disappear".
Kevin Phillips
@phillipskevin
when are you setting them up?
qantourisc
@qantourisc
Mostly if not all can.components, and members of the ViewModel
curse the lack of clear RAII on JS ;)
Kevin Phillips
@phillipskevin
are you calling it in init?
qantourisc
@qantourisc
yes
Kevin Phillips
@phillipskevin
ok, can you do it in inserted instead? (or the connectedCallback in newest versions)
qantourisc
@qantourisc
Sorry, i feel to green in javascript memory management to provide the answers you seek without so many questions.
I think running them during inserted would be possible yes.
Kevin Phillips
@phillipskevin
if you can set up the listeners in inserted then you can remove the listeners in beforeremove
also, there are probably better ways to do these things without having to manually setup/teardown event handlers
can-component's events object does this cleanup for you
qantourisc
@qantourisc
Looks intrestesting, i'm tempted to call ViewModel.my_cleanup() from beforeremove for my convienece though.
Kevin Phillips
@phillipskevin
or using derived properties in the viewmodel is even better
qantourisc
@qantourisc
Derived sound nice. he! reminds me of some ugly code I have going.
I have a DefineMap that combines 2 DefineMaps into a new view, with writable properties, but .... I had to manually bind and trigger events in the combining DefineMap.
Ideally it would have been a DefineMap.value function thing, but I couldn't get writes to work to it
Kevin Phillips
@phillipskevin
that is what the prop.lastSet is for
for handling when the property is set
qantourisc
@qantourisc
ooo, thanks i'll look into that after doing this other unrelated change !
It works, but it's yet another bind ;)
qantourisc
@qantourisc
let some_leaf = can.compute(()={
   if (this.a === undefined) return undefined;
   return this.a.b;
});
some_leaf.on("change",()....);
Is there a better way to said above ?
This message was deleted
RanjanSubbiah-tc
@RanjanSubbiah-tc
@phillipskevin how's it going? can I bug you for some help with the question I posted above ?
Kevin Phillips
@phillipskevin
@RanjanSubbiah-tc sorry, busy day. Yeah, as far as I know that should work.
@qantourisc can you share more of the code?
qantourisc
@qantourisc
@phillipskevin Not sure how to show more code. The idea is I wish to be notified if a map.map.map.key is set when map.map hasn't been set yet. As such you can't listen to the changes yet.
and observer/compute seems sanest ?
Kevin Phillips
@phillipskevin
yeah, an observation would work
Dovid Bleier
@dbleier
hello, not sure if I should post here or in steal, but when I build my app and try to run under production.html I am getting the following error that I have never seen before