Where communities thrive


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

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

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

  • 09:49
    chasenlehara edited #5384
  • 09:47
    chasenlehara edited #3864
  • 09:46
    chasenlehara edited #5383
  • Oct 17 20:12

    matthewp on master

    Update dist for release (compare)

  • Oct 17 20:12

    matthewp on v6.1.2

    Update dist for release 6.1.2 (compare)

  • Oct 17 20:04

    matthewp on master

    Update dist for release (compare)

  • Oct 17 20:04

    matthewp on v6.1.2-0

    Update dist for release 6.1.2-0 (compare)

  • Oct 17 19:17
    akbaruddin starred canjs/canjs
  • Oct 17 17:25
    matthewp edited #5384
  • Oct 17 17:00

    matthewp on can-dom-mutate-2.0.7

    (compare)

  • Oct 17 17:00

    matthewp on master

    fix(package): update can-dom-mu… Merge pull request #5386 from c… (compare)

  • Oct 17 17:00
    matthewp closed #5386
  • Oct 17 16:27
    greenkeeper[bot] labeled #5386
  • Oct 17 16:27
    greenkeeper[bot] opened #5386
  • Oct 17 16:27

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

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

  • Oct 17 16:25

    matthewp on can-dom-mutate-2.0.6

    (compare)

  • Oct 17 16:24
    matthewp closed #5379
Kevin Phillips
@phillipskevin
yeah, that's annoying
if you right click in the devtools panel and click "reload frame" it fixes it
obviously, not a great workaround :smile:
Gregg Roemhildt
@roemhildtg
That's what I'm doing for now. It works fine, but yeah eventually a nice polished devtools will be good, which I'm sure you'll get to. I mean its already so much easier to debug than a year ago, and having the viewmodel editor makes it a lot easier to get others up to speed on the stuff I'm working on
Good documentation is one thing...but being able to play with the viewmodel in dev tools makes it super simple
Kevin Phillips
@phillipskevin
:thumbsup: we'll keep improving it
Gregg Roemhildt
@roemhildtg
I'm thinking I might even build the viewmodel editor into demo projects.
Kevin Phillips
@phillipskevin
yeah, I'm going to post on the forums how to add it to demo pages
Gregg Roemhildt
@roemhildtg
Not sure how feasible that is at the moment but having a sort of editor like some libs have would be a really nice tool
Kevin Phillips
@phillipskevin
it's not too bad to add to demo pages
Gregg Roemhildt
@roemhildtg
Okay :)
I wonder, like down the road could the view model editor get passed a tag, like componentSelector:raw="my-component"
And then the viewmodel editor would just pick that component's viewmodel?
That would make it super easy to embed in a demo
Kevin Phillips
@phillipskevin
yeah, that would be tough
well, we could create a component that wraps the current one and does that
but for it to work in devtools it can only take in serialized data
Kevin Phillips
@phillipskevin
same-comp-fix.gif
@roemhildtg here's the fix for that issue... I'm going to put the index of that element in the tagName
and reset the data when the tagName changes
Viktor Busko
@Lighttree
Guys is there big difference between such getters in VM ?
get someProp() {
        return 'something';
},

// VS

someProp: {
    get() {
         return 'something';
    }
}
Maybe some preferences when to use
kostya.aderiho
@kaderiho

Hi guys, is there any way to save DefineList data on the server using PUT request?

For instance:

const Todo = DefineMap.extend({ ... some properties ... });

Todo.List = DefineList.extend({ "#": Todo });

let TodosList = new Todo.List([ ...several items there... ]);

// send PUT request here with TodoList inside of the body

Thank you in advance

Matthew Phillips
@matthewp
are you using can-rest-model?
kostya.aderiho
@kaderiho
So I'm using canjs v3 and can-connect as a middleware for data layer
Matthew Phillips
@matthewp
ok cool
so when you call .save() what happens?
Oh, do you mean you need it to use PUT even for new items?
kostya.aderiho
@kaderiho
I need to use PUT for already retrieved items by .getList method. If I understand correctly I can not do TodoList.save() because .save works for one instance only
Matthew Phillips
@matthewp
why can't you do todoList.forEach(todo => todo.save()) ?
kostya.aderiho
@kaderiho
It's an option but it will cause a lot of requests in case of large list :)
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