https://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git
git reset --soft HEAD~3 &&
git commit
| // Assume useEffect is run along a <Context.Provider> | |
| // function YourProvider() { | |
| // <insert here our firebase useEffect from below> | |
| // return <SomeContext.Provider /> | |
| // } | |
| useEffect(() => { | |
| async function run() { | |
| const firebase = (await import("@/libs/firebase")).default; | |
| const unsubscriber = firebase.auth().onAuthStateChanged(async (user) => {}); |
| ### Keybase proof | |
| I hereby claim: | |
| * I am dangdennis on github. | |
| * I am dangggit (https://keybase.io/dangggit) on keybase. | |
| * I have a public key ASCke7f_6v5Przwo7cej5G806Yq9MnI5tLWL-rwgLKKmlAo | |
| To claim this, I am signing this object: |
| // http://jamesknelson.com/re-exporting-es6-modules/ |
| // Future versions of Hyper may add additional config options, | |
| // which will not automatically be merged into this file. | |
| // See https://hyper.is#cfg for all currently supported options. | |
| module.exports = { | |
| config: { | |
| // choose either `'stable'` for receiving highly polished, | |
| // or `'canary'` for less polished but more frequent updates | |
| updateChannel: 'stable', |
| [@bs.module "./routes.js"] [@react.component] | |
| external make: (~name: string) => React.element = "default"; |
https://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git
git reset --soft HEAD~3 &&
git commit
| render: self => | |
| <div> | |
| <ul> | |
| <li> <Link href="/"> {str("Home")} </Link> </li> | |
| <li> <Link href="/page1"> {str("Page 1")} </Link> </li> | |
| <li> <Link href="/page2"> {str("Page 2")} </Link> </li> | |
| <li> <Link href="/page3"> {str("Page 3")} </Link> </li> | |
| <li> <Link href="/nested/page4"> {str("Nested Page")} </Link> </li> | |
| <li> <Link href="/auth/*"> {str("Wild Card Auth Page")} </Link> </li> | |
| </ul> |
| initialState: () => {route: Home}, | |
| /* Inside the make function of a React component */ | |
| didMount: self => { | |
| let watchId = | |
| /* Re.React gives us Router API */ | |
| ReasonReact.Router.watchUrl(url => | |
| self.send( | |
| /* url.search, url.hash is also available */ | |
| switch (url.path) { | |
| | [""] |
| /* Using Belt API for familiarity */ | |
| open Belt; | |
| /* Will return an array of posts */ | |
| let fakeRealApi = "https://jsonplaceholder.typicode.com/posts"; | |
| /* Defining types for the expected posts */ | |
| type post = { | |
| userId: int, | |
| id: int, |
| /* | |
| The fast pipe operator -> places the primary input in the FIRST argument position | |
| Let's look at its use with Belt's List.map in a couple scenarios | |
| */ | |
| module FastPipe = { | |
| /* Recall Belt's List.map signature | |
| let map: (list('a), 'a => 'b) => list('b); */ | |
| let add5 = n => n + 5; /* callback func */ | |
| /* The list of integers are inserted as the first argument */ |