ストーリー駆動開発のためのシンプルなライブラリ
Narrativeは、Rustのトレイトで表現されたストーリーに基づいてソフトウェアの全体または一部を開発するためのライブラリです。主にE2Eテスト用に設計されていますが、そのシンプルさから様々な用途に対応できます。
I'd like to propose "Neovim No-Nonsence Protocol" as the working name for this project to help our discussion. It can also be used as the official name when releasing it if no nice names are found.
for i <- 2..10000 do | |
spawn(fn -> | |
# `rem(a, b)` returns the remainder of a / b. | |
Dispatcher.listen(Pattern.new(fn x -> x > i and rem(x, i) == 0 end)) | |
receive do | |
x -> IO.puts("#{x} is not a prime number because #{x} is divisible by #{i}") | |
end | |
end) | |
end |
# This is a comment. | |
# Allows you to use SomeModule with the long path. | |
alias Too.Long.Path.To.SomeModule | |
# This is needed for using macros in SomeModule. | |
require SomeModule | |
# Spawns a new process that prints a result of 1 + 1. | |
spawn(fn -> |
# Things to prepare | |
alias Cizen.Dispatcher | |
alias Cizen.Pattern | |
require Pattern | |
# Dispatch something | |
Dispatcher.dispatch(10) | |
Dispatcher.dispatch({:ok, %{body: "Hello World"}}) | |
# Listens numbers less than 10. |
git clone https://github.com/andytill/erlyberly.git && cd erlyberly
defmodule Server do | |
use GenServer | |
def init(pid) do | |
{:ok, pid} | |
end | |
def handle_info({:DOWN, _ref, :process, _object, _reason}, state) do | |
{:stop, :normal, state} | |
end |
mix new cizen_dining_philosophers | |
cd cizen_dining_philosophers |
import React from 'react'; | |
import { connect } from 'react-redux'; | |
import { pageSelector } from './selectors.js'; | |
import { taskPage, relaxPage } from './pages.js'; | |
import TaskPage from './TaskPage.js'; | |
import RelaxPage from './RelaxPage.js'; | |
import ErrorPage from './ErrorPage.js'; | |
const mapStateToProps = state => { | |
const page = pageSelector(state); |
これはredux-middlewaresの紹介です。
Middlewareがどのようなものかついては、非常に分かりやすい記事があるのでそれを貼っておきます。
http://qiita.com/kuy/items/57c6007f3b8a9b267a8e
僕がMiddlewareを活用するようになったのは、この記事を読んでからです。