I hereby claim:
- I am coffee-cup on github.
- I am jakerunzer (https://keybase.io/jakerunzer) on keybase.
- I have a public key ASDTrMY_EQHLlcJ212YVW-cxv3wYPthoxTDlu48BUDqdpwo
To claim this, I am signing this object:
import { Store } from "./types" | |
import { MobXProviderContext } from 'mobx-react' | |
export const useStores = (): Store => { | |
return React.useContext(MobXProviderContext) | |
} |
import { observable, action } from "mobx"; | |
import newUUID from "uuid/v4"; | |
export class Store { | |
todos = observable<{ | |
[id: string]: { | |
text: string; | |
done: boolean; | |
}; | |
}>({}); |
import * as React from "react" | |
import { connect } from "react-redux" | |
import { State } from "./types" | |
interface Props { /* ... */ } | |
interface EnhancedProps { /* ... */ } | |
const MyComponent: React.FC<Props & EnhancedProps> = props => ( | |
/* ... */ | |
) |
import * as firebase from "firebase/app"; | |
import { AnyAction } from "redux"; | |
import { ThunkAction } from "redux-thunk"; | |
import { State } from ".."; | |
import { Database } from "../../database"; | |
export interface ThunkExtraArguments { | |
firebase: firebase.app.App; | |
reactReduxFirebase: any; | |
database: Database; |
// src/thunks.ts | |
import { Action } from 'redux' | |
import { sendMessage } from './store/chat/actions' | |
import { AppState } from './store' | |
import { ThunkAction } from 'redux-thunk' | |
export const thunkSendMessage = ( | |
message: string | |
): ThunkAction<void, AppState, null, Action<string>> => async dispatch => { |
// src/store/chat/reducers.ts | |
import { | |
ChatState, | |
ChatActionTypes, | |
SEND_MESSAGE, | |
DELETE_MESSAGE | |
} from './types' | |
const initialState: ChatState = { | |
messages: [] |
// src/store/chat/types.ts | |
export const SEND_MESSAGE = "SEND_MESSAGE"; | |
export const DELETE_MESSAGE = "DELETE_MESSAGE"; | |
interface SendMessageAction { | |
type: typeof SEND_MESSAGE; | |
payload: Message; | |
} | |
interface DeleteMessageAction { |
const callbackToPromise = method => (...args) => { | |
return new Promise((resolve, reject) => { | |
method(...args, (err, res) => { | |
if (err) reject(err); | |
resolve(res); | |
}) | |
}) | |
} | |
const callbackTimeout = (time, callback) => setTimeout(callback, time); |
I hereby claim:
To claim this, I am signing this object:
{ | |
"always-semicolon": true, | |
"block-indent": " ", | |
"color-case": "upper", | |
"color-shorthand": false, | |
"element-case": "lower", | |
"eof-newline": true, | |
"leading-zero": false, | |
"quotes": "single", | |
"remove-empty-rulesets": true, |