This file contains 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
// This file allows us to inspect the traffic going over the Native <-> JS bridge, and can be | |
// helpful for debugging. Setting this to true should never be committed to git | |
const ENABLE_BRIDGE_DEBUGGER = false; // <-- THIS SHOULD NOT BE TRUE IN MASTER!!!! | |
// if true, function arguments will get pretty printed | |
const PRETTY_PRINT = false; | |
// enable this if you want to ignore EVERY event, except for the ones that match the `FOCUSED_*` | |
// constants. If true, you configure what you want to see. If false, you configure what you DONT | |
// want to see. |
This file contains 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 org.scalajs.dom | |
object ScalaJSExample extends js.JSApp{ | |
case class FieldName(name : String , tpe : String) | |
def main(): Unit = { | |
val name = "SeedCategory" |
This file contains 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
[ | |
{ | |
"name": "User", | |
"kind": "OBJECT", | |
"interfaces": [ | |
"Node" | |
], | |
"fields": [ | |
{ | |
"name": "id", |
This file contains 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
val customFullOpt = Def.taskKey[File]("Generate the file ..") | |
artifactPath in Compile in customFullOpt := | |
baseDirectory.value / "final-bundle.js", | |
customFullOpt in Compile := { | |
val outFile = (artifactPath in Compile in customFullOpt).value | |
val loaderFile = (resourceDirectory in Compile).value / "loader.js" // file to prepended | |
IO.copyFile(loaderFile, outFile) | |
val fullOutputCode = IO.read((fullOptJS in Compile).value.data) |
This file contains 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
@ScalaJSDefined | |
class Hello extends React.Component { | |
def render() = { | |
Reac.createElement("div") | |
} | |
} | |
// render | |
React.render(React.createFactory(new Hello()), dom.document.body) |
This file contains 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
//snippets of rx and scalajs-react for my research .. | |
trait RxObserver extends OnUnmount { | |
def observe[T](rx: Rx[T])(f: T ⇒ Unit) = { | |
val obs = rx foreach f | |
onUnmount(obs.kill()) | |
} | |
} | |
object RxObserver { |
This file contains 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
trait CommonValueClass extends Any | |
class Type1 private(val name : String) extends CommonValueClass | |
object Type1 { | |
val SCALA = new Type1("scala") | |
} | |
class Type2 private(val option : String) extends CommonValueClass |
NewerOlder