Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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)

  • Oct 14 14:42
    m-mujica closed #5374
  • Oct 14 14:42
    m-mujica closed #5365
  • Oct 14 14:09
    f-ricci starred canjs/canjs
  • Oct 14 13:55
    greenkeeper[bot] commented #5375
  • Oct 14 13:55

    greenkeeper[bot] on core-js-3.3.2

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

  • Oct 14 10:51
    m-mujica review_requested #5374
  • Oct 14 07:43
    rjgotten commented #5358
Matthew Phillips
@matthewp
There's the combine-requests behavior that combines requests together
not sure if it works for saving though...
pinging @justinbmeyer in case he has a solution for this
I think combine-requests only works for getting lists
Justin Meyer
@justinbmeyer
I think someone asked this and posted solution in the forums
kostya.aderiho
@kaderiho
Seems that combineRequests works only for get (getListData) requests (according to the documentation), is it correct guys or not?
Frank Lemanschik
@frank-dspeed
i would say
1 reqest per save is total ok
if you need to save more data then simply do a custom batch via a endpoint that supports that
Matthew Phillips
@matthewp
@kaderiho yep, that is correct
Frank Lemanschik
@frank-dspeed
but out of my view you should save the item on creation
there is no case where you save more then 1 item at time and if you batch edit items via your interface directly
you end up in 1 request per processed item
thats total ok
else simply send item ids and changes to the backend and process them there
a batch endpoint would be a simple endpoint that accepts json lists
then you do getList and post that json to that endpoint
your done
the endpoint then takes that json list and does the for each serverside
I think that's the forum post @justinbmeyer is talking about
the linked to jsbin shows an example that does bulk deletes
Frank Lemanschik
@frank-dspeed
ya the question now is do you want to do bulk on the interface aka from the client side
or from the backend aka batch bulk enabled api endpoint
Justin Meyer
@justinbmeyer
@jeroencornelissen I think I shared some code too
Frank Lemanschik
@frank-dspeed
this is your code
it adds a destroyList method
that sends the json to a endpoint that does the foreach
:D
Justin Meyer
@justinbmeyer
that's my code?
Frank Lemanschik
@frank-dspeed
yes
Justin Meyer
@justinbmeyer
I generally don't write code like that
Matthew Phillips
@matthewp
it's from that forum post, not sure if you wrote it or @jeroencornelissen did
Frank Lemanschik
@frank-dspeed

@justinbmeyer suggested this on the gitter channel:

I would put a destroyList or some method on your list that makes the requests
and then call destroyedInstance on each one (assuming can-connect)

I have tried that but couldn’t make it work. The items are updated when calling Item.Connection.destroyedInstance(item, {title: 'destroyed'});. The title changes to destroyed, but I expected them to get removed from the list.

See this fiddle 3:

ah ok
it was gregromhild
sorry
:D
readed it wrong i tought he copyed your text
Justin Meyer
@justinbmeyer
I remember giving code IN gitter, I wish there was a link to the gitter thread
Frank Lemanschik
@frank-dspeed
if you got gitter pro
you should be able to find it
do you got a pro account?
it has infinity history and search
as far as i remember
Justin Meyer
@justinbmeyer
basically, the .save() on a list would need to update the instances correctly
there's a way to do that
Frank Lemanschik
@frank-dspeed
dispatch
Justin Meyer
@justinbmeyer
it's not dispatch