Skip to content

Instantly share code, notes, and snippets.

View chasestarr's full-sized avatar
🎒
""

Chase Starr chasestarr

🎒
""
View GitHub Profile
<Username
handler={this.handler} // <---- 'handler' will be available from `props.handler` within the component
username={this.state.username}
/>
__________________________________
class Username extends React.Component {
render() {
// model file
// is this a bad idea?
class Gig extends MongoModel {
/**
* extends the functionality of model update method
*
* @param {string} query - object to query db on
* @param {any[]} args - arguments to forward to parent class update
*/
import React from 'react';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { selectLoggedInUserId } from 'modules/auth/selectors';
import { SolidButton } from 'modules/core/components';
import GIGSTER_COLORS from 'modules/core/constants/GIGSTER_COLORS';
import * as userActions from '../../../actions';
import {
{
summary: {
gig: {
milestones: {}
},
},
}
// vs
import { selectMany as selectManyTodos } from 'modules/todos/selectors';
// ...
const selectTodoIdsFromProps = (_, props) => props.todoIds || [];
export const selectTodos = () =>
createSelector(selectManyTodos(selectTodoIdsFromProps));
@chasestarr
chasestarr / reducer-field-selector.js
Created December 3, 2017 02:45
got kind of carried away and thought better of it - still wanted to save tho ;p
import { createSelector } from 'reselect';
function selectPayouts = state => state.payouts;
/**
* Provided application state, returns a function that accepts a payoutId and returns a payout
*
* @returns {string => ?Object}
*/
export function makeSelectPayout = state => payoutId => {
@chasestarr
chasestarr / snippet.html
Created January 5, 2018 17:06 — forked from trun/snippet.html
Snippet for Gigster
<script>
// standard drift snippet
!function() {
function t() {
t.__q.push(Array.prototype.slice.call(arguments));
}
t.__q = [];
var e = window.drift = window.driftt = window.drift || window.driftt || t, i = [ "identify", "init", "track", "reset", "debug", "show", "ping", "page", "hide", "off", "on", "config" ];
i.forEach(function(t) {
e[t] || (e[t] = function() {
<head>
<link rel="stylesheet" href="node_modules/fortune-css/dist/fortune.css" />
</head>
<body class="m-2">
<div style="display: flex; flex-direction: row">
<div class="b-1">
<div class="h-2 w-2 g-1" style="background-color: var(--blue);"></div>
</div>
<div class="b-1">
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>