Where communities thrive


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

    greenkeeper[bot] on core-js-3.5.0

    chore(package): update core-js … (compare)

  • Dec 11 18:34
    greenkeeper[bot] labeled #5444
  • Dec 11 18:34
    greenkeeper[bot] opened #5444
  • Dec 11 18:34

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

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

  • Dec 11 18:30

    cherifGsoul on update-infrastructure-page

    (compare)

  • Dec 11 18:30

    cherifGsoul on master

    Update infrastructure page with… (compare)

  • Dec 11 18:30
    cherifGsoul closed #5441
  • Dec 11 18:30
    cherifGsoul closed #5417
  • Dec 10 17:40
    cherifGsoul review_requested #5443
  • Dec 10 16:47
    cherifGsoul review_requested #5441
  • Dec 10 16:35
    cherifGsoul synchronize #5441
  • Dec 10 16:35

    cherifGsoul on update-infrastructure-page

    Fix typos (compare)

  • Dec 10 10:01
    jkeruzec starred canjs/canjs
  • Dec 09 18:59
    cherifGsoul review_requested #5443
  • Dec 09 18:59
    cherifGsoul opened #5443
  • Dec 09 18:51

    cherifGsoul on document-inserted-removed-can6

    Add inserted/removed events to … (compare)

  • Dec 09 15:38
    greenkeeper[bot] labeled #5442
  • Dec 09 15:38
    greenkeeper[bot] opened #5442
  • Dec 09 15:38

    greenkeeper[bot] on can-view-live-5.0.1

    fix(package): update can-view-l… (compare)

Justin Meyer
@justinbmeyer
@Bajix you could swap the fall-through-cache strategy with cache-requests
and you'd pretty much have what you want
Christopher Oliphant
@RALifeCoach
@justinbmeyer the bitballs example assumes standard API calls. I don’t have control over the API end and that is true for most developers working on legacy systems.
Justin Meyer
@justinbmeyer
sure, but that has nothing to do with using "inserted" to load data
Thomas Sieverding
@Bajix
Ok
Leath Cooper
@IcculusC
just curious, I looked at you guys for a job a while back and saw that you are CEO and "basketballer"
Christopher Oliphant
@RALifeCoach
I would love to use stache loading, but I spent 4 days beating my head against that wall before conceeding defeat
Justin Meyer
@justinbmeyer
I'm not sure what stache loading is
@Bajix cache-requests always will hit what's in the store
so if you loaded all data ... then loaded a subset ... it will never go back to the server
it's really good for real-time
Thomas Sieverding
@Bajix
@justinbmeyer What would prevent it from automatically using data-url?
Justin Meyer
@justinbmeyer
it uses data-url if it doesn't have the data already
say you wrote
Todo.getList({})
it would hit GET /todos
then you wrote
Todo.getList({userId: 5})
Christopher Oliphant
@RALifeCoach
Referencing the superMap tag in the stache file, showing “Is Loading” while isPending is true, and then displaying the the stache for the component, once the data is loaded.
Justin Meyer
@justinbmeyer
it would use the todos returned by {}
Thomas Sieverding
@Bajix
For my use case, I want to explicitely disable data-url
Justin Meyer
@justinbmeyer
not for the first load though right?
Thomas Sieverding
@Bajix
As the data will be loaded after the fact
I’m delaying loading findAll until a websocket connection is established
Justin Meyer
@justinbmeyer
@RALifeCoach ok ... but that's different than what I'm talking about
Thomas Sieverding
@Bajix
Then I’m loading based off of time, and letting my websocket connection publish going forward
Christopher Oliphant
@RALifeCoach
Sorry, there are several different conversations going on at once
Justin Meyer
@justinbmeyer
@Bajix what do you mean by "based off time"?
sounds like you need a data-websocket behavior.
Thomas Sieverding
@Bajix
I have a creation time on my data, and I would want to query things created before connecting, but after the crreation time of the last thing cached
Justin Meyer
@justinbmeyer
ah ... last thing cached in localstorage?
Thomas Sieverding
@Bajix
Yes
Justin Meyer
@justinbmeyer
this is a perfect opportunity for a behavior
Thomas Sieverding
@Bajix
Oh?
Justin Meyer
@justinbmeyer
like .. this is exactly the scenario can-connect was built to handle
Thomas Sieverding
@Bajix
I know ;p
Justin Meyer
@justinbmeyer
well built to be ABLE to handle
doesn't handle it
Thomas Sieverding
@Bajix
Though I don’t see why data-websocket would be a behavior
Justin Meyer
@justinbmeyer
you query the websocket once it's connected for the new things right?
Thomas Sieverding
@Bajix
Nope
Though I suppose I could do it that way
Justin Meyer
@justinbmeyer
when / how do you query the new things?
Thomas Sieverding
@Bajix
I would query things using findAll after my websocket connection is online
Justin Meyer
@justinbmeyer
oh ... I would fire getList and forget
Thomas Sieverding
@Bajix
Then I’d use something like hydrateInstance to handling incoming data from my websocket connection
Justin Meyer
@justinbmeyer
ok, so I'm not sure how all this works ... but let me take a stab at some sudo code
Thomas Sieverding
@Bajix
Sure
onData: function( packet ) {
  var action = packet[0],
    data = packet[2];

  switch (action) {
    case 'DELETE channel':
      return Channel.model(data).destroyed();
    case 'DELETE message':
      return Message.model(data).destroyed();
    case 'DELETE user':
      return User.model(data).destroyed();
    case 'channel':
      return this.dispatch('channel', [Channel.model(data)]);
    case 'message':
      return this.dispatch('message', [Message.model(data)]);
    case 'user':
      return this.dispatch('user', [User.model(data)]);
  }
},
This is an example of a similar use-case to what I’m building now