Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/state / __tests__ / obsberverWithObservableProps.test.tsx
Size: Mime:
// /**
//  * @example using updateForProps
//  */
// interface EhProps {
//   maxValue?: number
// }
//
// import { observable, action } from 'xmobx/mobx'
// class State {
//   @observable maxValue: number = 0
//
//   @action setMaxValue(maxValue: number) {
//     this.maxValue = maxValue
//   }
//
//   @action update(values: EhProps) {
//     Object.keys(values).forEach(key => {
//       this[key] = values[key]
//     })
//   }
// }
//
// import * as React from 'react'
// import { observerWithObservableProps } from './deps.updateForProps'
//
// @observerWithObservableProps
// class Eh extends React.Component<EhProps> {
//   observableState = new State()
//
//   updateState(value: EhProps) {
//     console.log('props changed o.o')
//     this.observableState.update(value)
//   }
// }

describe('observer with observable props', () => {
  it.skip('should have a full support', () => {
    // todo
  })
})