Use this config with Haul, the Webpack packager for React Native.
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
export const ensureMutationId: Plugin = builder => { | |
builder.hook('GraphQLObjectType:fields:field', (field, build, context) => { | |
const {pgSql: sql} = build | |
const { | |
scope: { | |
isPgUpdateMutationField, | |
isPgCreateMutationField, | |
isPgDeleteMutationField, | |
}, | |
} = context |
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
open StateTypes; | |
let toOption = Js.Nullable.toOption; | |
let (getWithDefault, getExn) = Js.Option.(getWithDefault, getExn); | |
[@bs.module "redux"] external createStore : ('a, 'b, 'c) => 'd = ""; | |
[@bs.module "redux"] external applyMiddleware : ('a, 'b) => 'c = ""; | |
let identity = a => a; |
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
let compose = (second, first, errors) => { | |
let result = first(errors); | |
Array.length(result) > 0 ? result : second(result); | |
}; | |
let isString = input => Js.typeof(input) === "string"; | |
let check = (condition, error) => | |
Array.append(condition() ? [||] : [|error|]); |
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 ioRedis; | |
[@bs.new] [@bs.module] external ioRedis : unit => ioRedis = "ioredis"; | |
[@bs.send] external set : (ioRedis, string, string, string, int) => Js.Promise.t(string) = ""; | |
[@bs.send] external get : (ioRedis, string) => Js.Promise.t(Js.Nullable.t(string)) = ""; | |
[@bs.send] external on : (ioRedis, string, unit => unit) => unit = ""; |
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 koaRouter; | |
[@bs.module] external koaRouter : koaRouter = "koa-router"; | |
[@bs.new] external newRouter : unit => koaRouter = "KoaRouter"; | |
[@bs.send] external get : (koaRouter, string, 'a => Js.Promise.t(unit)) => unit = ""; | |
[@bs.send] external post : (koaRouter, string, 'a => Js.Promise.t(unit)) => unit = ""; |
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 React, {Component} from 'react' | |
import {newTodo} from './NewTodo.purs' | |
class NewTodoView extends Component { | |
render () { | |
const {addTodo, nextId} = this.props | |
return ( | |
<header className="header"> | |
<h1>todos</h1> | |
<input className="new-todo" |
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
module Todo.Components.NewTodo (newTodo) where | |
import Prelude | |
import Control.Monad.Eff (Eff) | |
import React (ReactClass) | |
import React.Recompose (withHandlers) | |
import Todo.State.Todos (add) as Todos | |
import Redux.Mini (connect) | |
-- Props |
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
module: { | |
// PureScript | |
loaders: [{ | |
test: /\.purs$/, | |
loader: 'purs', | |
exclude: /node_modules/, | |
query: { | |
psc: 'psa', | |
src: ['bower_components/purescript-*/src/**/*.purs', 'src/**/*.purs'], | |
warnings: false, |
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
export async function fetchGoogleProfile (accessToken) { | |
const response = await axios.get(GOOGLE_PROFILE_URL, { | |
headers: { | |
'Content-Type': 'application/json', | |
'Authorization': `Bearer ${accessToken}`, | |
}, | |
}) | |
return response.data | |
} |
NewerOlder