This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package chandu0101.macros.tojs | |
| import japgolly.scalajs.react.CallbackTo | |
| import scala.collection.{GenMap, GenTraversableOnce} | |
| import scala.language.experimental.macros | |
| import scala.reflect.macros.blackbox | |
| import scala.scalajs.js | |
| /** | |
| * modified version of https://github.com/wav/scala-macros/blob/master/src/main/scala/wav/common/scalajs/macros/Macros.scala | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class WrapBackendScope[P, S](b: BackendScope[P, S]){ | |
| def props = CallbackTo[P](b.props) | |
| def state = CallbackTo[S](b.state) | |
| def both = CallbackTo[(P, S)]((b.props, b.state)) | |
| def modState(f: S => S, cb: Callback = Callback.empty): Callback = | |
| state >>= (s => b.setState(f(s), cb)) | |
| def modStateCB(f: S => CallbackTo[S], cb: Callback = Callback.empty): Callback = | |
| state >>= (s => b.setStateCB(f(s), cb)) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import japgolly.scalajs.react.BackendScope | |
| import japgolly.scalajs.react.extra._ | |
| import scalaz.syntax.id._ | |
| final case class CachingBackendScope[P: Reusability, S: Reusability] | |
| (b: BackendScope[P, S]){ outer ⇒ | |
| type PropVal[O] = ReactVal[P, O] | |
| type StateVal[O] = ReactVal[(P, S), O] | 
NewerOlder