Where communities thrive


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

    greenkeeper[bot] on can-super-model-2.0.0

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

  • 00:13
    greenkeeper[bot] labeled #5448
  • 00:13
    greenkeeper[bot] opened #5448
  • 00:13

    greenkeeper[bot] on can-define-rest-model-2.0.0

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

  • 00:12
    greenkeeper[bot] labeled #5447
  • 00:12
    greenkeeper[bot] opened #5447
  • 00:12

    greenkeeper[bot] on can-define-realtime-rest-model-2.0.0

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

  • 00:07
    greenkeeper[bot] labeled #5446
  • 00:07
    greenkeeper[bot] opened #5446
  • 00:07

    greenkeeper[bot] on can-connect-ndjson-2.0.0

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

  • Dec 13 21:27

    greenkeeper[bot] on @octokit

    (compare)

  • Dec 13 21:25

    greenkeeper[bot] on @octokit

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

  • Dec 13 21:21

    greenkeeper[bot] on @octokit

    (compare)

  • Dec 13 21:20

    greenkeeper[bot] on @octokit

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

  • Dec 12 19:26
    cherifGsoul review_requested #5443
  • Dec 12 18:34
    cherifGsoul synchronize #5443
  • Dec 12 18:34

    cherifGsoul on document-inserted-removed-can6

    Update after review (compare)

  • Dec 12 17:44

    cherifGsoul on theme-3.0.0-pre.5

    (compare)

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
(though a dispatch happens)
I'd look it up but in the middle of something
Frank Lemanschik
@frank-dspeed
i saw in some examples that there was custom dispatch on stuff like
can-define backup
thats why i got that idea
Justin Meyer
@justinbmeyer
essentially you would need to re-create what the normal .save() does on every item in the list