Where communities thrive


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

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

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

  • 19:08
    cherifGsoul labeled #5390
  • 19:07
    cherifGsoul opened #5390
  • 18:45
    greenkeeper[bot] labeled #5389
  • 18:45
    greenkeeper[bot] opened #5389
  • 18:45

    greenkeeper[bot] on can-observable-bindings-1.3.0

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

  • 18:29

    matthewp on master

    Update dist for release (compare)

  • 18:29

    matthewp on v6.1.3

    Update dist for release 6.1.3 (compare)

  • 17:59

    matthewp on can-observable-array-1.0.2

    (compare)

  • 17:59

    matthewp on master

    fix(package): update can-observ… Merge pull request #5388 from c… (compare)

  • 17:59
    matthewp closed #5388
  • 16:46
    greenkeeper[bot] labeled #5388
  • 16:46
    greenkeeper[bot] opened #5388
  • 16:46

    greenkeeper[bot] on can-observable-array-1.0.2

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

  • 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
Thomas Sieverding
@Bajix
Well it’s breaking bundling for me
If you’d like to screen share, maybe I could show you?
Matthew Phillips
@matthewp
yeah sure
Thomas Sieverding
@Bajix
Screen Hero?
Matthew Phillips
@matthewp
yeah
Thomas Sieverding
@Bajix
My handle is Bajix
Gira Minus
@gKreator
When creating and updating a form with canjs. Does it make sense to update a form model everytime it is changed?
So in a viewModel I keep a name: { type: 'string', value: 'Jeff' }
then update it on input change
rather then reading the value with dom functions later?
than*
Kevin Phillips
@phillipskevin
you can't easily write tests for code using the dom directly, so I would use the viewModel
Gira Minus
@gKreator
ok that makes sense
Real quick... what is the best way to re initialize a component that is inside another component?
Kevin Phillips
@phillipskevin
pass the data in with stache bindings
Gira Minus
@gKreator
but what if i had logic in the init: function() that i wanted to execute?
Kevin Phillips
@phillipskevin
depends what that logic does, but there's usually a better place to put that code
Sunil George
@georgesunil81
This may be a naive question, but I want to ask anyways to see if there is a best practice recommendation. I have a controller (can.Control) in my CanJS application that is quite bloated with over 2000 lines of code. Is there a way to break certain logically related methods out into a separate js file and import it or something? I am using AMD modules.
Kevin Phillips
@phillipskevin
a naive answer is yes, but without knowing what that code does, it’s hard to say how
why is your controller doing so much?
sort of a rhetorical question, but something you should ask yourself
Sunil George
@georgesunil81
@phillipskevin . Thanks. The can.Control has many event handler methods since the page it is rendering is rather element rich.
Kevin Phillips
@phillipskevin
so maybe some of those should be in their own components
(or controls if that’s your thing)
Sunil George
@georgesunil81
Yeah, it could have been done that way. Right now, there is only one controller that renders and controls that element rich page. So, I am trying to see if I can put some related methods out to seperate js files and AMD-import it.
Kevin Phillips
@phillipskevin
sure
I don’t know that it’s going to make it easier to read your code though
not as much as actually breaking down the functionality into multiple stand-alone pieces
but you can take any event handler and move it to its own file
Sunil George
@georgesunil81
Yeah, that is what I have to balance between - readability/maintainability vs "too many" lines of code.
Thanks @phillipskevin for the insights there. Will do.
Kevin Phillips
@phillipskevin
if your event handlers are using this, you’ll need to figure out how to bind those functions if you import them
Sunil George
@georgesunil81
Yes, some of the event handlers do refer to this! Thanks @phillipskevin for the pointer.
Justin Meyer
@justinbmeyer
@/all If you have nested structures and can-connect … this will make your life much easier: https://github.com/canjs/can-connect/releases/tag/v1.2.0 (docs out soon)
seasoup
@seasoup
Hey, I'm trying to use fixture from this tutorial a https://canjs.com/doc/guides/todomvc.html
but am getting this error: undefined is not an object (evaluating 'can.fixture.store')
"can": "^3.3.1"
import can from "can";
import "can-define";
import DefineMap from "can-define/map/map";
import DefineList from "can-define/list/list";
doing these imports:
seasoup
@seasoup
needed to npm install can-fixture --save
Gira Minus
@gKreator
You really dont need the "can"
Mohamed Cherif Bouchelaghem
@cherifGsoul
you should use import can from "can-util" for can3.x
seasoup
@seasoup
using can 3, I have a define map passed into a template and am showing some html based on the value of one of the attributes (page), how can I update the define map so that the template changes
var data = new DefineMap({
body: "BODY",
page: "event-group"
});
document.body.appendChild(template(data));
data.page = newVal;
the last line doesn't update the template
Gira Minus
@gKreator
Can you make a jsbin?
seasoup
@seasoup
got it working, thanks!
Gira Minus
@gKreator
Is there a way to prevent canJs stache {{#each}} only re-render the item that is updated and not all of them?