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
Thomas Sieverding
@Bajix
This would only work on insertion
Also, but why?
Christopher Oliphant
@RALifeCoach
I have the insertion working fine. I need help getting the update to work.
Why? An idea suggested by Justin.
Kevin Phillips
@phillipskevin
@justinbmeyer in many ways my code is quite simple. All data is display only. There is some binding against controls, but not against the data itself.
This message was deleted
This message was deleted
Thomas Sieverding
@Bajix
Yea, I think you’ve misconstrued what he was saying
Kevin Phillips
@phillipskevin
@RALifeCoach if that's the case, I wouldn't convert it to a Map at all
since Justin won’t be around until later this evening, I took a guess that he meant to just pass the raw data to the template renderer
then we went down this rabbit hole
Christopher Oliphant
@RALifeCoach
@Bajix any ideas on how to pass an object into the component?
Thomas Sieverding
@Bajix
can.view(‘#my-template’, { player: {} }, function( frag ) { … })
Christopher Oliphant
@RALifeCoach
that gets it in - what about updating?
Thomas Sieverding
@Bajix
You have several options. 1) Update it within the component. 2) Update your root scope lexically 3) Use sibling components, write to the reference scope & have your main component bind to changes 4) Use can.viewModel 5) Use Model stores to indirectly update data
can.view will accept a PJSO, can.Map instance, or can.view.Scope instance
Christopher Oliphant
@RALifeCoach
  1. I understand
  2. I do not understand
  3. I understand
  4. How would I access can.viewModel from outside the component?
  5. I do not know what you mean by Model stores?
Thomas Sieverding
@Bajix
You could use a can.view.Scope instance to build a scope tree from multiple can.Map instances, that would traverse in reverse order
Christopher Oliphant
@RALifeCoach
Remember, the goal is to avoid using can.Map.
Thomas Sieverding
@Bajix
That’s a silly goal
If you pass a PJSO into can.view, it’ll become a can.Map instance regardless
Christopher Oliphant
@RALifeCoach
lol - it was suggested by Justin - I am just trying to figure out what he meant
Thomas Sieverding
@Bajix
He meant you should use type: ‘*’
Christopher Oliphant
@RALifeCoach
Here is his statement, "if that's the case, I wouldn't convert it to a Map at all”
and using ‘*’ requires a map
Kevin Phillips
@phillipskevin
like I said before, I think he might have said that thinking that you don’t need to update the data
“the case” in the statement “if that’s the case” was that your data didn’t need binding
Thomas Sieverding
@Bajix
You would need to use a can.Map.extend that takes advantage of type: ‘*’ to prevent those properties from automatically being converted
If you just pass a PJSO into can.view, it’s the same as constructing a can.Map
The only way to avoid implicitely construction can.Map / can.List instances is to explicitely use type: ‘*’ on those properties
Christopher Oliphant
@RALifeCoach
You could be right. I will await his return and see what he has to say on the matter. I managed to solve the problem, and that was fun.
It is now time for me to run. Thanks again for all your help and assistance.
Thomas Sieverding
@Bajix
I can assure you my above statements are accurate
Justin will say the same
Christopher Oliphant
@RALifeCoach
@Bajix I will be optimistic and see what Justin has to offer, although I expect you are right.
Justin Meyer
@justinbmeyer
@RALifeCoach I didn't have time to read through everything, but in regards to the recent comments, I didn't mean type: "*"
if your data is only for view only
and doesn't change
you could use can-connect to load non-observable plain JS data
and just pass that to stache
If you just pass a PJSO into can.view, it’s the same as constructing a can.Map -> that's not accurate
there's no conversion to can.Map and there's no event binding.
computes are still created, and those computes are bound to ... but then we see that the computes have no observable dependencies and they are discarded
Thomas Sieverding
@Bajix
I’m confused then. You can still cross-bind to properties passed into can.view
Justin Meyer
@justinbmeyer
not POJO properties
if I do can.stache("<h1>{{message}}</h1>")({message: "HI"})
That will output <h1>Hi</h1>
but there won't be any event binding
and it won't implicitly convert {message: "HI"} into a map or anything