Skip to content

Instantly share code, notes, and snippets.

View hottmanmichael's full-sized avatar

Michael Hottman hottmanmichael

  • Juno Travel
  • Denver
View GitHub Profile
// things.js
import React, { Component } from 'react';
import withNavigation from './with_navigation';
// This is just an example component that, when clicked, calls the navigate prop
// and is wrapped in withnavigation
class Things extends Component {
handleNavigate = () => {
this.props.Navigation.navigate('/somewhere');
@hottmanmichael
hottmanmichael / example.js
Last active April 18, 2019 04:03
Necto Action Example
import users from './path-to-users-necto';
store.dispatch(
users.Actions.someAction(
'User clicked some button',
{ foo: 'someFooChange' },
{ someMeta: 'someMeta' }
)
);
/*
@hottmanmichael
hottmanmichael / index.js
Created April 18, 2019 03:57
Necto Example
import Necto from 'necto';
const users = new Necto('users', {
initialState: {
foo: 'bar',
bar: 'foo',
},
});
export const someAction = users.createFlow(
@hottmanmichael
hottmanmichael / actions.js
Created April 18, 2019 03:54
Generic Redux Example
import Constants from './constants';
export const someAction = foo => ({
type: Constants.SOME_ACTION,
foo,
});
export const someOtherAsyncAction = bar => ({
type: Constants.SOME_OTHER_ASYNC_ACTION,
bar,
});
@hottmanmichael
hottmanmichael / global.coffee
Last active December 3, 2018 23:14
Marionette Proptypes Proof of Concept
checkPropTypes = require("./helpers/prop_types").checkPropTypes
_.extend Marionette.View.prototype,
checkPropTypes: () ->
if @propTypes then checkPropTypes.apply(@, arguments)
return this