These are chat archives for canjs/canjs

22nd
Jan 2018
Gregg Roemhildt
@roemhildtg
Jan 22 2018 15:08
Any ideas why updating can.route.data.propName would fail to update the route? The route looks like this {page}/{propName} and I'm setting route.data.propName = null but the route doesn't end up changing. This is in donejs with can-route-pushstate, but removing pushstate for hashes has the same result in this case
Kevin Phillips
@phillipskevin
Jan 22 2018 17:27
@roemhildtg my only guess would be that the serialized representation of can.route.data isn't changing
to see what's going on
Gregg Roemhildt
@roemhildtg
Jan 22 2018 17:34
Yeah, that function isn't being called
onRouteDataChange
I'm passing route.data to a component, and that component is binding to a route value
so in my parent component:
routeData: {
    value(){
        return route.data;
    }
}
<my-component id:bind="routeData.propName" />
If I call route.data.serializethat does look different though. So the map itself is getting updated
Kevin Phillips
@phillipskevin
Jan 22 2018 17:38
Gregg Roemhildt
@roemhildtg
Jan 22 2018 17:38
Yup
Just playing around with different ideas here....
If I don't use the value() method above, and use soemthing like this, it started working:
  id: {
    get(){
      return route.data.a;
    },
    set(id){
      route.data.a = id;
      return id;
    }
  },
<my-component id:bind="id" />
wait...it stopped again. Could it be live-reload messing up?
Gregg Roemhildt
@roemhildtg
Jan 22 2018 17:43
Yup, that's what's doing it. Live reload appears to be doing something funky
It stops working when the file is saved/reloaded
in both methods
Kevin Phillips
@phillipskevin
Jan 22 2018 17:47
strange
maybe @matthewp has an idea
Gregg Roemhildt
@roemhildtg
Jan 22 2018 17:51
I can make an issue to better explain what I'm doing. steal-tools or can-route?
Gregg Roemhildt
@roemhildtg
Jan 22 2018 18:01
stealjs/steal-tools#930
Kevin Phillips
@phillipskevin
Jan 22 2018 18:01
thanks
that seems like the right place