How to use the spy function from mobx

Find comprehensive JavaScript mobx.spy code examples handpicked from public code repositorys.

39
40
41
42
43
44
45
46
47
48
49
  return observable
}


function namedCrossTabDecorator (name) {
  return function (target, key, descriptor) {
    mobx.spy(function (event) {
      if (event.type !== 'add') return
      if (event.key !== key) return
      if (!target.isPrototypeOf(event.object)) return

fork icon0
star icon1
watch icon0

+ 3 other calls in file

3
4
5
6
7
8
9
10
11
12
function print(event) {
  console.log(event);
}

function init() {
  spy(event => {
    switch (event.type) {
      case 'action':
      case 'transaction':
      case 'reaction':
fork icon0
star icon0
watch icon2

+ 13 other calls in file