Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 19 17:27
    greenkeeper[bot] labeled #5428
  • Nov 19 17:27
    greenkeeper[bot] opened #5428
  • Nov 19 17:27

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

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

  • Nov 19 16:49
    cherifGsoul opened #5427
  • Nov 19 16:39

    cherifGsoul on obserbale-properties-update-debugging-guid

    (compare)

  • Nov 19 16:39

    cherifGsoul on master

    Remove ViewModel wording from d… Fix observable properties wordi… Fix typo and 2 more (compare)

  • Nov 19 16:39
    cherifGsoul closed #5425
  • Nov 19 16:29
    cherifGsoul synchronize #5425
  • Nov 19 16:29

    cherifGsoul on obserbale-properties-update-debugging-guid

    Fix another typo (compare)

  • Nov 19 15:25
    cherifGsoul synchronize #5425
  • Nov 19 15:25

    cherifGsoul on obserbale-properties-update-debugging-guid

    Fix typo (compare)

  • Nov 19 10:20
    greenkeeper[bot] labeled #5426
  • Nov 19 10:20
    greenkeeper[bot] opened #5426
  • Nov 19 10:19

    greenkeeper[bot] on can-attribute-observable-2.0.2

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

  • Nov 18 21:05

    nlundquist on master

    Update dist for release (compare)

  • Nov 18 21:05

    nlundquist on v6.2.6

    Update dist for release 6.2.6 (compare)

  • Nov 18 20:22
    cherifGsoul review_requested #5425
  • Nov 18 20:22
    cherifGsoul commented #5425
  • Nov 18 20:19
    cherifGsoul synchronize #5425
  • Nov 18 20:19

    cherifGsoul on obserbale-properties-update-debugging-guid

    Fix observable properties wordi… (compare)

Gregg Roemhildt
@roemhildtg
Line 42, I think it does, unless I'm missing something.
Kevin Phillips
@phillipskevin
but that's just when the watch is triggered, right?
sorry, maybe that makes sense
so you're saying onKeyValue is called, then whatever triggers watch happens, and your handlers don't update the template?
Gregg Roemhildt
@roemhildtg
Right
Kevin Phillips
@phillipskevin
ok
getKeyValue shouldn't have to be called after that in order for it to work
Gregg Roemhildt
@roemhildtg
I think I have it working pretty much like I have in my dev setup
Brad Momberger
@bmomberger-bitovi
I think you might be doing too many handler dispatches. You make a watch for every onKeyValue, but each watch handler goes over the entire handlers list.
I don't know that this is the root of the live problem, but it couldn't hurt to clean that up.
Oh! I do see one thing that might be a problem with your @@can.getKeyValue. It's using can-util/js/get/get, which doesn't use canReflect.getKeyValue to access properties.
Brad Momberger
@bmomberger-bitovi
If you want to read deep paths on an object, I would recommend trying can-stache-key.get instead.
Gregg Roemhildt
@roemhildtg

You make a watch for every onKeyValue, but each watch handler goes over the entire handlers list.

I'm not following, shouldn't each watch handler call each handler that is listening for that key's changes?

Brad Momberger
@bmomberger-bitovi
If you have two watches on one key, and that key changes, then two watches each call two handlers.
Gregg Roemhildt
@roemhildtg
Ohh, I see
Yes that would happen
Gregg Roemhildt
@roemhildtg
I'm not sure how to use can-stache-key, but what if I just add observation.add(obj, key) to the get function from can-util?
wouldn't that trigger the getKeyValue
Brad Momberger
@bmomberger-bitovi
Yeah, if you want to just copy and modify the get function, that should work too
Frank Lemanschik
@frank-dspeed
does somebody in here maybe know the behavier of steal optimized bundels from done-autorender (done-apps)?
the bundels are including the needed code but i think some init stuff is needed that not done automaticly
i think as steal optimize gets the index.stache!done-autorender
it should autorender as expected behavier right?
Chasen Le Hara
@chasenlehara
^ I don’t think we’ve finished making the optimized builds work in a regular DoneJS app, maybe @matthewp can comment though
Matthew Phillips
@matthewp
Optimized builds do not work with done-autorender apps, that is correct.
Going to start working on it soon hopefully.
Nico R.
@nriesco
Hi, I found this in the docs: https://canjs.com/doc/can-validate.html but couldn’t understand how to use it in a form, any ideas?
I was looking for an easy way to support HTML “required” fields
Nico R.
@nriesco
or providing a custom method
swipie
@swipie
We get a lot of warnings about a property that is not in the current scope and that the property is read from the parent scope. It is resolved when we do {{ ../myprop}} instead of {{myprop}} but is this the right way to solve these warnings?
Kevin Phillips
@phillipskevin
Sorry the docs that warning links to haven't been published yet. There are a few ways to resolve this
image.png
Hopefully you can read that. Yes, if you want to read the prop from the parent scope, ../myProp is the correct way to do it.
Kevin Phillips
@phillipskevin
if there are places where you think ../myprop isn't the right way to do it, let us know @swipie
Brad Momberger
@bmomberger-bitovi
Got ninja'd by @phillipskevin, but I was going to add that reading explicitly from the scope level where your prop exists will help ease the upgrade process to future major revisions of can-stache
Frank Lemanschik
@frank-dspeed
lol ninjaed
new term :)
i use normaly outsmartned
Brad Momberger
@bmomberger-bitovi
It's not quite outsmarted, just that someone else got in a correct or agreeing response while you were composing your own.
Frank Lemanschik
@frank-dspeed
ok if you say so
Frank Lemanschik
@frank-dspeed

Streaming can-component

const Nils = require('../../')
const defineMap = require('can-define/map/map')
const Component = require('can-component')
const view = require('index.stache')

const app = new Nils()

const viewModel = defineMap.extend({sealed: false},{})


// Init ViewModel
// could be also a defineMap->Stream
app.stream.of({
  inputX: '',
  inputY: ''
})
// Observe DOM Elements
// return { update, assign }
.combineArray((observed)=>observed,[
  app.fromInput(document.querySelector('input.x'))
  .map((val)=>{
  return { inputX: val }
  }),
  app.fromInput(document.querySelector('input.y'))
  .map((val)=>{
    return { inputY: val }
  })
])
// Returns the ViewModelUpdating State aka can-x-connect :)
// This can also be a complet Can Component
// its only for demo
.loop(function applyVM(lastSetVal, setVal){
  let seed = lastSetVal.viewModel.updateDeep(setVal)
  return return { seed, value: seed };
},Component.extend({
  tag: 'kasse-login',
  ViewModel,
  view
}))
// Acticvate the Stream All gets executed as sideEffect
.map((comp)=>comp.render())
.drain()
what do you think about that?
for small components you can even drop can component and directly render stach
Brad Momberger
@bmomberger-bitovi
You named your app for @nlundquist ?
Frank Lemanschik
@frank-dspeed
no thats the name from my son
here you can read about Nils
:D