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 { configure } from '@storybook/react'; | |
function loadStories() { | |
require('../src/stories'); | |
} | |
configure(loadStories, module); |
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, Welcome } from '@storybook/react/demo'; | |
storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('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 users = [ | |
{ name: "Rick", age: 60 }, | |
{ name: "Morty", age: 14 }, | |
{ name: "John Doe", age: 30 } | |
]; | |
const names = users.map(user => user.name); | |
// [ 'Rick', 'Morty', 'John Doe' ] |
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 users = [ | |
{ name: "Rick", age: 60 }, | |
{ name: "Morty", age: 13 }, | |
{ name: "John Doe", age: 30 } | |
]; | |
const names = []; | |
for (var i = 0; i < users.length; i++) { | |
const name = users[i].name; | |
names.push(name); |
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 createConnect from 'redux-connect-standalone'; | |
import store 'path/to/youStore'; | |
export const connect = createConnect(store); |
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 { connect } from 'path/to/youConnect'; | |
export default connect( | |
mapStateToProps, | |
mapDispatchToProps | |
)(YourContainer); |
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, { Component } from 'react'; | |
import ngDeps from 'path/to/ngDeps'; | |
class Login extends Component { | |
constructor(props) { | |
super(props); | |
const { $state, $rootScope } = ngDeps; | |
this.$state = $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
import { injectNgDeps } from 'path/to/ngDeps'; | |
angular | |
.module('app', []) | |
.run([ | |
'$rootScope', | |
'$state', | |
($rootScope, $state) => { | |
injectNgDeps({ $rootScope, $state }); | |
}, |