View gist:b29b989a441f6e7f7ba0da565d93962c
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
### Keybase proof | |
I hereby claim: | |
* I am ktruong008 on github. | |
* I am ktruong008 (https://keybase.io/ktruong008) on keybase. | |
* I have a public key ASBeEpy6J3FzgX4_0fd7reDtu_dvkE6rJLXqsjANCjdC1Ao | |
To claim this, I am signing this object: |
View date-utc.js
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
Date.getUTCDate() | |
Date.getUTCDay() | |
Date.getUTCHours() | |
Date.toUTCString() |
View date.js
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
Date.getDate() | |
Date.getDay() | |
Date.getHours() | |
Date.toString() |
View hasura-first-look-example.ts
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 promotionsFetchEpic = ( | |
action$: ActionsObservable<PayloadAction>, | |
state$: StateObservable<StoreState>, | |
): Observable<PayloadAction> => | |
action$.pipe( | |
filter((action) => action.type === appDataFetchSuccess.toString()), | |
asyncRequest( | |
promotionsFetchStart.toString(), | |
promotionsFetchSuccess.toString(), | |
promotionsFetchError.toString(), |
View script-tag-ex
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
// app.middleware.js | |
const buildScriptTagSrcUrl = (): string => { | |
return process.env.SCRIPT_TAG_URL || ''; | |
}; | |
export const initializeApp = async (ctx) => { | |
... | |
await createScriptTag( | |
buildScriptTagSrcUrl(), |
View graphql-setup
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
// cross-sell.graphql.ts | |
export const crossSellQueryTypeDefinitions = ` | |
crossSell(crossSellId: Int): CrossSell | |
productCrossSells(productId: String): [CrossSell!] | |
`; | |
export const crossSellTypeDefinitions = ` | |
type CrossSell { | |
displaysProductPrice: Boolean |
View graphql-request.ts
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
// shared.ts | |
export const graphqlRequest = async <T>( | |
query: string, | |
variables = {}, | |
): Promise<T> => { | |
const headers = { | |
...buildContentTypeHeader('application/json'), | |
}; |
View gist:17097a1d57c3601744c6979830c401d8
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 * as React from 'react'; | |
import { Field, FormSection } from 'redux-form'; | |
import IntlLink from '../../core/intl/intlLink/intlLink.container'; | |
import { LOCATION } from '../../core/location/location.types'; | |
import { IntlText } from '../../core/intl/intlText/intlText.container'; | |
import { Input, Radio, Button, Icon, Text } from '../../components'; | |
import { Address } from '../address/address.fieldset'; | |
import { Name } from '../name/name.fieldset'; | |
import { |
View gist:09e7839fb22b2f0833a4512ce6d4549c
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 { createSelector, createStructuredSelector } from 'reselect'; | |
import { getFormValues } from 'redux-form'; | |
import { AppStateT, LoginStateT, FORM_NAMES, LOCATION } from '../../core/types'; | |
import { selectPreviousPageType, selectKind } from '../../core/location/location.selectors'; | |
export const selectLogin = (state: AppStateT) => state.login; | |
export const selectAuthenticated = createSelector( | |
selectLogin, | |
(loginState: LoginStateT) => loginState.authenticated |
View .js
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 { path, find, propEq } from 'ramda'; | |
import { createSelector } from 'reselect'; | |
import { | |
AppStateT, | |
UserProfileT, | |
BusinessNameSearchesT, | |
BusinessNameSearchesSearchesT, | |
UserDetailsT, | |
PaymentOrderT, | |
BUSINESS_REGISTRATION_STATUS, |
NewerOlder