Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
| Working with DOM | Working with JS | Working With Functions |
|---|---|---|
| Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
| Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle/Debounce Functions |
| Create DOM Elements | Conditionals |
Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist.
Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).
Trying to deploy from a inner folder to gh-pages, you must have the transpiled assets in the desired directory.
If you want to deploy from the dist folder you should commit it to gh-pages branch.
- Run this
git subtree push --prefix dist origin gh-pages - In the GitHub project Settings, down to Github Pages, and in Source branch select: gh-pages.
That's it
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 { connect } from 'react-redux'; | |
| import Book from '../components/Book'; | |
| import { removeBook } from '../actions'; | |
| const filtering = (books, filterRes) => (filterRes === 'All' ? books : books.filter(book => book.category === filterRes)); | |
| const BookList = ({ books, filter }) => ( | |
| <div> | |
| {filtering(books, filter).map(book => ( |
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 { useDispatch, useSelector, shallowEqual } from 'react-redux'; | |
| import Book from '../components/Book'; | |
| import { removeBook } from '../actions'; | |
| const filtering = (books, filterRes) => (filterRes === 'All' ? books : books.filter(book => book.category === filterRes)); | |
| export default BookList = () => { | |
| const books = useSelector(state => state.books, shallowEqual) || []; | |
| const filter = useSelector(state => state.filter) || {}; |
OlderNewer