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
| import React from 'react' | |
| import { storiesOf } from '@storybook/react' | |
| import { action } from '@storybook/addon-actions' | |
| import { linkTo } from '@storybook/addon-links' | |
| import {Button} from '../src/index' | |
| storiesOf('Button', module) | |
| .add('simple text', () => <Button title='Hello Button' onClick={action('clicked Hello Button')} />) |
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
| const RTM = require('satori-rtm-sdk') | |
| // create an RTM client instance | |
| const rtm = new RTM('YOUR_ENDPOINT', 'YOUR_APPKEY') | |
| // create a new subscription with 'your-channel' | |
| const channel = rtm.subscribe('YOUR_CHANNEL', RTM.SubscriptionMode.SIMPLE) | |
| // add channel data handlers |
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
| import React from 'react' | |
| import RTM from 'satori-rtm-sdk' | |
| class Index extends React.Component { | |
| state = {} | |
| componentDidMount () { | |
| const rtm = new RTM('YOU_ENDPOINT', 'YOUR_APPKEY') | |
| const channel = rtm.subscribe('YOUR_CHANNEL', RTM.SubscriptionMode.SIMPLE) |
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
| function SomeService () { | |
| this.name = 'some'; | |
| } | |
| SomeService.prototype.method = function(params) { | |
| // Do some shit like... | |
| console.log(this.name); | |
| } | |
| module.exports = new SomeService(); |
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
| function someService () { | |
| const name = 'some'; | |
| function method() { | |
| // Do some shit like... | |
| console.log(name); | |
| } | |
| return { method }; | |
| } |
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
| const name = 'some'; | |
| function method() { | |
| // Do some shit like... | |
| console.log(name); | |
| } | |
| module.exports = { method } |
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
| function extractResponse (response) { | |
| if (response.status === 200) { | |
| return response.data | |
| } | |
| return [] | |
| } | |
| function processError (err) { | |
| logger.error(err) |
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
| class Connected extends React.PureComponent { | |
| constructor (props, context) { | |
| super(props, context) | |
| this.blah = createNewBlah() | |
| } | |
| componentWillWhatever() { | |
| // Do anything here | |
| } |
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
| import express from 'express' | |
| import { status } from './middlewares/status' | |
| const app = express() | |
| app.get('/api/status', status) | |
| export const handler = app |
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
| import axios from 'axios' | |
| const createUrlLoader = url => { | |
| const initialState = { | |
| loading: false, | |
| data: null, | |
| error: null | |
| } | |
| const STARTED_LOADING = 'STARTED_LOADING' |