How to use the @graffy/common.sieve function in @graffy/common

To help you get started, we’ve selected a few @graffy/common 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 usegraffy / graffy / src / fill / subscribe.js View on Github external
function putValue(value, isChange) {
    if (typeof value === 'undefined') return;
    // console.log('Fill/subscribe: PutValue', value);

    if (isChange) {
      // console.log('Data before sieve', debug(data));
      const sieved = sieve(data, value);
      // console.log('Data after sieve', debug(data));
      if (!sieved.length) return;
      merge(payload, sieved);
    } else {
      merge(data, value);
      // console.log('Payload before adding value', debug(payload));
      if (raw) merge(payload, value);
      // console.log('Payload after adding value');
    }

    let { known, unknown, extraneous } = slice(data, originalQuery);
    data = known || [];

    // console.log('After slice', debug(data), unknown && debug(unknown));
    // console.log('Payload and value', debug(payload), value && debug(value));