// @flow | |
interface Command<A> { | |
run(): A; | |
} | |
class Call<A> implements Command<A> { | |
value: () => A; | |
constructor<X>(f: X => A, x: X) { |
package fpmax | |
import scala.util.Try | |
import scala.io.StdIn.readLine | |
object App0 { | |
def main: Unit = { | |
println("What is your name?") | |
val name = readLine() |
// This is an advanced example! It is not intended for use in application code. | |
// Libraries like Relay may make use of this technique to save some time on low-end mobile devices. | |
// Most components should just initiate async requests in componentDidMount. | |
class ExampleComponent extends React.Component { | |
_hasUnmounted = false; | |
state = { | |
externalData: null, | |
}; |
[options] | |
module.name_mapper='^most-subject$' -> '<PROJECT_ROOT>/most-subject' |
//@flow | |
declare export function curry3<A, B, C, D>(fn: (a: A, b: B, c: C) => D): ( | |
& ((a: A, nob: void, noc: void) => ( | |
& ((b: B, noc: void) => ((c: C) => D)) | |
& ((b: B, c: C) => D) | |
)) | |
& ((a: A, b: B, noc: void) => ((c: C) => D)) | |
& ((a: A, b: B, c: C) => D) | |
) |
import java.util.concurrent.ArrayBlockingQueue | |
import scala.concurrent.{ExecutionContext, Future} | |
/** | |
* Rick's implementation of ghetto back-pressure algo | |
* Implement this trait and pass it off to ProducerConsumer.Runner to run it | |
* | |
* @tparam R Type of result to be crunched | |
* @tparam S State to iterate on |
I’m amazed by React and how it’s bringing happiness to our developer lives. I specially like the workflow that integrates Webpack + React + CSS Modules + Babel among other tools and preprocessors. That’s why Javier Jiménez and I are working together in a library called React Toolbox that we would like to show in a lightning talk at Reactive Conference.
The main idea is to create a set of React components implementing Material Design guidelines. There are already some libraries that solve a similar problem but our project is mostly focused on the workflow and best practices to create a tool everybody would want to use. Also, we are sticking to the design guidelines proposed by Google and embracing minimalism by generating the minimum possible amount of HTML and styles to get the best result. Our workflow includes among others:
- Webpack.
- ES6 with Babel
- Unit t
##Погодное одностраничное веб-приложение
(!) Данные можно взять с сайта openweathermap.org или с любого другого сервиса.
(!) Обязательно использовать react.js и redux.
Приложение должно уметь:
- Добавлять/удалять города
- Сохранять локально данные
// Example for lukaseichler.de/how-to-test-dispatch-request/ | |
import dispatch.{HttpExecutor, _} | |
import dispatch.Defaults._ | |
val httpMock = mock[HttpExecutor] | |
(httpMock.apply(_: (Request, AsyncHandler[String]))(_: ExecutionContext)) | |
.expects(*, *) | |
.returning(Future[String] { | |
"Hello World" |