How to use the kefir.Property function in kefir

To help you get started, we’ve selected a few kefir examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github calmm-js / karet.util / dist / karet.util.cjs.js View on Github external
function updateObs(prevObs, nextProps, plain) {
  var nextObs = {};
  for (var k in nextProps) {
    var v = nextProps[k];
    if (plain(k)) {
      nextObs[k] = v;
    } else {
      var obs = nextObs[k] = prevObs[k] || new K.Property().skipDuplicates(I.identicalU);
      obs._emitValue(v);
    }
  }
  for (var _k2 in prevObs) {
    if (!plain(_k2)) {
      var _v = prevObs[_k2];
      if (_v !== nextObs[_k2]) {
        _v._emitEnd();
      }
    }
  }
  return nextObs;
}
github calmm-js / karet.util / dist / karet.util.es.js View on Github external
function updateObs(prevObs, nextProps, plain) {
  var nextObs = {};
  for (var k in nextProps) {
    var v = nextProps[k];
    if (plain(k)) {
      nextObs[k] = v;
    } else {
      var obs = nextObs[k] = prevObs[k] || new Property().skipDuplicates(identicalU);
      obs._emitValue(v);
    }
  }
  for (var _k2 in prevObs) {
    if (!plain(_k2)) {
      var _v = prevObs[_k2];
      if (_v !== nextObs[_k2]) {
        _v._emitEnd();
      }
    }
  }
  return nextObs;
}
github calmm-js / karet.util / src / karet.util.js View on Github external
function updateObs(prevObs, nextProps, plain) {
  const nextObs = {}
  for (const k in nextProps) {
    const v = nextProps[k]
    if (plain(k)) {
      nextObs[k] = v
    } else {
      const obs = (nextObs[k] =
        prevObs[k] || new K.Property().skipDuplicates(I.identicalU))
      obs._emitValue(v)
    }
  }
  for (const k in prevObs) {
    if (!plain(k)) {
      const v = prevObs[k]
      if (v !== nextObs[k]) {
        v._emitEnd()
      }
    }
  }
  return nextObs
}
github mAAdhaTTah / brookjs / packages / brookjs-silt / src / withRef.tsx View on Github external
) => (
  WrappedComponent: React.RefForwardingComponent | React.ElementType<p>
) =&gt;
  class WithRef$ extends React.Component</p><p> {
    static displayName =
      typeof WrappedComponent !== 'string'
        ? wrapDisplayName(WrappedComponent, 'WithRef$')
        : `WithRef(${WrappedComponent})`;

    static Target: any = wrap(WrappedComponent);

    props$ = new Kefir.Stream()
      .toProperty(() =&gt; this.props)
      .setName(`${WithRef$.displayName}#props$`);

    ref$ = new Kefir.Property().setName(
      `${WithRef$.displayName}#ref$`
    );

    aggregated$?: Pool;

    plugged$?: Observable;

    refback = (el: E | null) =&gt; el &amp;&amp; (this.ref$ as any)._emitValue(el);

    componentWillUnmount() {
      this.aggregated$ &amp;&amp;
        this.plugged$ &amp;&amp;
        this.aggregated$.unplug(this.plugged$);
    }

    componentDidMount() {</p>

kefir

Reactive Programming library for JavaScript inspired by Bacon.js and RxJS with focus on high performance and low memory usage

MIT
Latest version published 4 years ago

Package Health Score

57 / 100
Full package analysis