Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 14:58
    greenkeeper[bot] commented #5372
  • 14:58

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

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

  • 14:49
    greenkeeper[bot] labeled #5379
  • 14:49
    greenkeeper[bot] opened #5379
  • 14:49

    greenkeeper[bot] on can-dom-mutate-2.0.6

    fix(package): update can-dom-mu… (compare)

  • 14:06

    greenkeeper[bot] on webpack-4.41.2

    (compare)

  • 13:37

    greenkeeper[bot] on webpack-4.41.2

    chore(package): update webpack … (compare)

  • Oct 14 21:13
    greenkeeper[bot] labeled #5378
  • Oct 14 21:12
    greenkeeper[bot] opened #5378
  • Oct 14 21:12

    greenkeeper[bot] on can-simple-map-4.3.3

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

  • Oct 14 20:19
    greenkeeper[bot] labeled #5377
  • Oct 14 20:19
    greenkeeper[bot] opened #5377
  • Oct 14 20:19

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Oct 14 20:18
    greenkeeper[bot] labeled #5376
  • Oct 14 20:18
    greenkeeper[bot] opened #5376
  • Oct 14 20:18

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Oct 14 14:43
    greenkeeper[bot] closed #5373
  • Oct 14 14:43

    greenkeeper[bot] on can-deep-observable-1.0.1

    (compare)

  • Oct 14 14:42

    m-mujica on update-deep-observable

    (compare)

  • Oct 14 14:42

    m-mujica on master

    Update can-deep-observable to l… Merge pull request #5374 from c… (compare)

Kevin Phillips
@phillipskevin
viewModel.attr(‘game’) calls that get()
but what you’ll need to do in your case is set up some way that gamePromise will return a new promise after some amount of time
I would try something like this:
define: {
  gamePromise: {
    get: function() {
      return this.getGamePromise();

      setTimeout(this.getGamePromise, 5000);
    }
  }
},
getGamePromise: function() {
  return Game.get({...})
}
hmm, that’s not going to work… because it won’t change the return value of gamePromise
let me try it in a JSBin
Adam Tourkow
@atourkow
It seems like there's a lot of ways to do things in canJS.
Mohamed Cherif Bouchelaghem
@cherifGsoul
@atourkow you may look at can-connect it does cool stuffs around ajax
Adam Tourkow
@atourkow
@cherifGsoul ok
Kevin Phillips
@phillipskevin
define: {
  gamePromise: {
    get: function(val, set) {
     this.getGamePromise().then(set);

      setTimeout(function() {
        this.getGamePromise().then(set);
      }, 5000);
    }
  }
},
getGamePromise: function() {
  return Game.get({...})
}
I’m still going to put together a jsbin, but I think that should work
Kevin Phillips
@phillipskevin
@atourkow that code above works if you only want to update once, so doesn’t solve your problem
here’s an example of updating the model every 1 second: http://jsbin.com/hamidalugi/edit?html,js,output
let me know if any of that doesn’t make sense
Adam Tourkow
@atourkow
@phillipskevin Thanks!
Kevin Phillips
@phillipskevin
no problem, hope it helped
Adam Tourkow
@atourkow
We'll see. gotta try it first
Here's a stupid question: I don't have the whole page as a view, so what's the best way to just put in a component? After defining the component, just make new template = can.stache('<mycomponent/>'); $('#elIWantMyComponentIn').append(template());
Kevin Phillips
@phillipskevin
you could also checkout can.autorender
Adam Tourkow
@atourkow
ok
Kevin Phillips
@phillipskevin
that way you could just put you stache script inside of #elIWantMyComponentIn and can would render it for you
Adam Tourkow
@atourkow
oh, how interesting
Kevin Phillips
@phillipskevin
but before that existed, we did it with basically the code you wrote
Adam Tourkow
@atourkow
@phillipskevin are you a canJS Dev?
Kevin Phillips
@phillipskevin
yeah, I’m a developer at Bitovi
so primarily do consulting with CanJS and our other tools
Adam Tourkow
@atourkow
@phillipskevin nice. I wish the word would spread more about canJS. I keep looking at other technlogies, bt find I like the way CanJS works the best
Kevin Phillips
@phillipskevin
Yeah, I hear you
we talk at a lot of meetups and conferences
Adam Tourkow
@atourkow
where are you based?
Kevin Phillips
@phillipskevin
if there’s a group in your area that you think it would be good for us to talk at, let us know
we work remotely, so we’re all over
Adam Tourkow
@atourkow
I've stopped doing coding for money, this is for my personal site. But, I'll definitely promote.
I still talk to devs all the time and meetups
Kevin Phillips
@phillipskevin
ok, awesome
if you haven’t, you should check out DoneJS
it’s our latest project that combines CanJS and StealJS and other tools that make it easy to build things out quickly
and there are some nice guides to get started
Adam Tourkow
@atourkow
Yep, I've looked into that and will probably use it if building from scratch
Justin Meyer
@justinbmeyer
Alex
@whitecolor
:thumbsup:
Adam Tourkow
@atourkow
(thumbsup)
Dovid Bleier
@dbleier
@justinbmeyer improvements to 2.3 look awesome. The blog post says latest is 2.3.11, but when I ran npm update can, I only got 2.3.10 according to the package.json
Dovid Bleier
@dbleier
@cherifGsoul, @whitecolor sorry for the delayed response, I was offline for a couple of days.
  1. I did not mean I want to remove can-define, I meant I would use can-define to remove the cycle2 plugin. Sorry for the confusion ;)
2 I'll take a look at turning the whole piece into its own component and see if that fixes the issue. I'll report back if I have further issue. thanks!
Mohamed Cherif Bouchelaghem
@cherifGsoul
@dbleier did you check my bin?
@dbleier yes I think the NPM package is not updated yet
Dovid Bleier
@dbleier
yes, briefly. I need to work on it to show what I want to accomplish, thanks for setting it up
Mohamed Cherif Bouchelaghem
@cherifGsoul
ok