This file contains hidden or 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 {import('tailwindcss').Config} */ | |
const plugin = require('tailwindcss/plugin'); | |
const reduce = require('lodash/reduce'); | |
const isString = require('lodash/isString'); | |
function wrapUtilities(utilities) { | |
// Hack to enable AutoCompletion on VSCode | |
// https://github.com/tailwindlabs/tailwindcss-intellisense/issues/227#issuecomment-1139895799 | |
return reduce( | |
utilities, |
This file contains hidden or 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 iOS code signing as p12 and mobileprovision file for usage in Appcenter | |
# Manual decryption as described on https://docs.fastlane.tools/actions/match/ | |
desc "Export fastlane match signing credentials for AppCenter" | |
lane :export_code_signing do | |
ensure_env_vars( | |
env_vars: [ | |
"MATCH_GIT_URL", | |
"MATCH_PASSWORD", | |
] |
This file contains hidden or 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
// | |
// NFCPassportReader.m | |
// StashawayApp | |
// | |
// Created by Sam Aryasa on 3/6/20. | |
// Copyright © 2020 Facebook. All rights reserved. | |
// | |
#import "React/RCTBridgeModule.h" |
This file contains hidden or 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
// HierarchylessDetoxReporter.js | |
// Custom jest reporter for wix/detox that surpress printing of the entire page's UI hierarchy on failed spec | |
// Github issue: https://github.com/wix/Detox/issues/992 | |
// Usage (in your jest config): "reporters": ["./e2e/HierarchylessDetoxReporter.js"], | |
const StreamlineReporter = require('detox/runners/jest/streamlineReporter'); | |
const HIERARCHY_REGEX_TRIMMER = /[\s\S]+?(?=Hierarchy)/; | |
class HierarchylessDetoxReporter extends StreamlineReporter { |
This file contains hidden or 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
// components/todos/index.js | |
import { connect } from 'react-redux'; | |
import Todos from './Todos'; | |
import { createLoadingSelector } from '../../redux/api/selectors'; | |
// Show loading when any of GET_TODOS_REQUEST, GET_USER_REQUEST is active | |
const loadingSelector = createLoadingSelector(['GET_TODOS', 'GET_USER']); | |
const mapStateToProps = (state) => ({ isFetching: loadingSelector(state) }); | |
export default connect(mapStateToProps)(Todos); |
This file contains hidden or 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
// api/errorReducer.js | |
export const errorReducer = (state = {}, action) => { | |
const { type, payload } = action; | |
const matches = /(.*)_(REQUEST|FAILURE)/.exec(type); | |
// not a *_REQUEST / *_FAILURE actions, so we ignore them | |
if (!matches) return state; | |
const [, requestName, requestState] = matches; | |
return { |
This file contains hidden or 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
// todo/reducer.js | |
const initialState = { todos: [] }; | |
export const todoReducer = (state = initialState, action) => { | |
switch(action.type) { | |
case 'GET_TODOS_SUCCESS': | |
return { ...state, todos: action.payload }; | |
default: | |
return state; | |
} | |
}; |
This file contains hidden or 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
// api/selectors.js | |
import _ from 'lodash'; | |
export const createLoadingSelector = (actions) => (state) => { | |
// returns true only when all actions is not loading | |
return _(actions) | |
.some((action) => _.get(state, `api.loading.${action}`)); | |
}; | |
// components/todos/index.js | |
import { connect } from 'react-redux'; |
This file contains hidden or 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
// api/loadingReducer.js | |
const loadingReducer = (state = {}, action) => { | |
const { type } = action; | |
const matches = /(.*)_(REQUEST|SUCCESS|FAILURE)/.exec(type); | |
// not a *_REQUEST / *_SUCCESS / *_FAILURE actions, so we ignore them | |
if (!matches) return state; | |
const [, requestName, requestState] = matches; |
This file contains hidden or 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
// todo/actions.js | |
export const getTodos = (dispatch) => () => { | |
dispatch({ type: 'GET_TODOS_REQUEST' }); | |
return fetch('/api/v1/todos') | |
.then((todos) => dispatch({ type: 'GET_TODOS_SUCCESS', payload: todos }) | |
.catch((error) => dispatch({ type: 'GET_TODOS_FAILURE', payload: error, error: true }); | |
}; | |
// todo/reducer.js | |
const initialState = { todos: [] }; |
NewerOlder