createModule({
home: '/',
login: '/login',
dashboard: {
path: '/dashboard',
module: createModule({
settings: '/settings',
myAccount: '/my-account',
}, {
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
Process: CamTwist [1578] | |
Path: /Applications/CamTwist/CamTwist.app/Contents/MacOS/CamTwist | |
Identifier: com.allocinit.CamTwist | |
Version: 3.4.3 (3.4.3) | |
Code Type: X86-64 (Native) | |
Parent Process: ??? [1] | |
Responsible: CamTwist [1578] | |
User ID: 501 | |
Date/Time: 2019-08-02 18:24:51.316 -0700 |
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 api from './api' | |
const routesMap = { | |
HOME: '/', // path only route | |
LIST: { // route object (with a path) | |
path: '/list/:slug', | |
thunk: async (dispatch, getState) => { | |
const { slug } = getState().location.payload | |
const response = await fetch(`/api/items/${slug}`) | |
const items = await data.json() |
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
// pages are purged when | |
// on userApproval in UserModel.approveCeleb | |
// on user update denies.js | |
var cloudflare_api_interface = "https://www.cloudflare.com/api_json.html"; | |
var cloudflare_token = "YOUR_TOKEN"; | |
var cloudflare_email = "YOUR_CLOUDFLARE_EMAIL"; | |
var domain = 'FILL_IN_YOUR_DOMAIN'; | |
var urls_to_purge = [ |
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
const Twit = Meteor.npmRequire('twit'); | |
Accounts.registerLoginHandler('twitter', function(params) { | |
const data = params.twitter; | |
// If this isn't twitter login then we don't care about it. No need to proceed. | |
if (!data) { | |
return undefined; | |
} |
Respond Framework is what happens if you build Redux & first-class concerns for routing into React, plus take a page from the traditional server-side MVC playbook when it comes to side-effects.
Here's a quick overview of the features and usage in Respond Framework.
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 { Box } from 'respond' | |
export function Items(props) { | |
return Box({ | |
style: { margin: 20, padding: 10 }, | |
children: [ | |
Item({ name: 'svelte' }), | |
Item({ name: 'react' }), | |
Item({ name: 'vue' }), | |
], |
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
const MyRespondModal = (props, state, actions) => ( | |
<Modal | |
visible={!!state.modalText} | |
text={state.modalText} | |
onClose={actions.cancel} | |
onSubmit={actions.confirm} | |
/> | |
) | |
const Modal = ({ visible, text, onClose, onSubmit }) => { |
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
export default createApp({ | |
components: { | |
App: (props, { location }) => { | |
const Component = location.components.list.ComponentWithHoistedDataDeps | |
return Component ? <Component /> : <Spinner /> | |
}, | |
}, | |
routes: { | |
LIST: { | |
path: '/list/:category', |
NewerOlder