npm.io
0.1.1 • Published 10 years ago

cerebral-computed

Licence
ISC
Version
0.1.1
Deps
1
Vulns
0
Weekly
0
Stars
1

cerebral-computed

A package allowing computed state dependencies in views

import computed from 'cerebral-computed';

export default computed({
  foo: 'some.state.path',
  bar: 'some.other.path'
}, state => {
  return state.foo + state.bar
})

This computed can be used in Cerebral view layers:

import myComputed from './myComputed.js'
import {Decorator as Cerebral} from 'cerebral-view-react'

@Cerebral({
  someProp: myComputed
})