How to use the mutant.map function in mutant

To help you get started, we’ve selected a few mutant 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 mmckegg / patchwork-next / plugs / message / html / meta / likes.js View on Github external
function names (ids) {
    var items = map(ids, api.about.obs.name)
    return computed([items], (names) => {
      return 'Liked by\n' + names.map((n) => `- ${n}`).join('\n')
    })
  }
}
github blockades / patchbay-dark-crystal / views / component / errors.js View on Github external
return computed(errors, errors => {
    if (isString(errors)) errors = [errors]
    if (isObject(errors)) errors = toArray(errors)

    return h('DarkCrystalErrors', [
      title,
      h('ul', map(errors, e => {
        return h('li', e.toString())
      }))
    ])
  })
}
github mmckegg / patchwork-next / modules / page / html / render / profile.js View on Github external
function nameList (prefix, ids) {
    var items = map(ids, api.about.obs.name)
    return computed([prefix, items], (prefix, names) => {
      return (prefix ? (prefix + '\n') : '') + names.map((n) => `- ${n}`).join('\n')
    })
  }
}

mutant

Create observables and map them to DOM elements. Massively inspired by hyperscript and observ-*. No virtual dom, just direct observable bindings. Unnecessary garbage collection is avoided by using mutable objects instead of blasting immutable junk all ove

MIT
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis