I would recommend working through all the articles in the Architecture Overview, The New Architecture, Migrating to the New Architecture sections. But that is a lot of information to digest at once, so I would starting with the following articles:
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
type validatorData('a) = { | |
value: 'a, | |
isTouched: bool, | |
submitted: bool, | |
}; | |
type shouldDisplayError('error) = { | |
error: 'error, | |
isTouched: bool, | |
submitted: bool, |
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
/** Developed with "downshift": "^3.4.1" */ | |
type highlightedIndex = int; | |
type isOpen = bool; | |
[@bs.module "downshift"] [@bs.scope "useSelect"] | |
external stateChangeTypes: { | |
. | |
"MenuKeyDownArrowDown": string, | |
"MenuKeyDownArrowUp": string, |
- Create a dune file:
(library
(public_name aggregate_ppx_name)
(kind ppx_rewriter)
(libraries ppx_deriving_protobuf other_ppx another_ppx))
- Build:
dune build --profile release
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
// Reason Macros! | |
// Use templates to write your code for you. | |
let%macro add5 = (input: ident, log: string) => { | |
if%eval (env("node_environment") != "production") { | |
Js.log(eval__input) | |
}; | |
eval__input + 5 | |
}; |
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
declare var __DEV__: boolean; | |
declare module 'react-native' { | |
declare type Color = string | number; | |
declare type Transform = | |
{ perspective: number } | | |
{ scale: number } | | |
{ scaleX: number } | |
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
class CamelCaseMiddleware | |
def call(parent_type, parent_object, field_definition, field_args, query_context, next_middleware) | |
next_middleware.call([parent_type, parent_object, field_definition, transform_arguments(field_args), query_context]) | |
end | |
def transform_arguments(field_args) | |
transformed_args = {} | |
types = {} | |
field_args.each_value do |arg_value| |
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
(defstate ReactNativeRouterFlux :start (js/require "react-native-router-flux")) | |
(defstate TabBar :start (.-TabBar @ReactNativeRouterFlux)) | |
(defstate Actions :start (.-Actions @ReactNativeRouterFlux)) | |
(defstate Modal :start (.-Modal @ReactNativeRouterFlux)) | |
(defstate Reducer :start (.-Reducer @ReactNativeRouterFlux)) | |
(defstate router :start (r/adapt-react-class (.-Router @ReactNativeRouterFlux))) | |
(defstate scene :start (r/adapt-react-class (.-Scene @ReactNativeRouterFlux))) | |
(defn reducerCreate [params] | |
(let [defaultReducer (@Reducer params)] |
NewerOlder