-
-
Save FlorianRappl/40b57e9a8f025c7ff0adee4a731de99b to your computer and use it in GitHub Desktop.
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 { render } from "react-dom"; | |
import { createInstance, Piral, Dashboard } from "piral"; | |
import { Layout, Loader } from "./layout"; | |
const instance = createInstance({ | |
requestPilets() { | |
return fetch("https://feed.piral.io/api/v1/pilet/sample") | |
.then(res => res.json()) | |
.then(res => res.items); | |
} | |
}); | |
const app = ( | |
<Piral instance={instance}> | |
<SetComponent name="LoadingIndicator" component={Loader} /> | |
<SetComponent name="Layout" component={Layout} /> | |
<SetRoute path="/" component={Dashboard} /> | |
</Piral> | |
); | |
render(app, document.querySelector("#app")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment