Skip to content

Instantly share code, notes, and snippets.

View mbensch's full-sized avatar

Marcel Bensch mbensch

View GitHub Profile
import { Module } from '../../core';
import AppContainer from './AppContainer.jsx';
const AppModule = new Module('App');
AppModule
.setInitialState({ counter: 0 })
// This will create Action Types (with normalized names) and Action Creators.
// The application container which is a wrapper around the redux store will
// compose all reducers of registered modules. The module name is used as key in the
import React, { Component } from 'react';
import { BasePageContainer } from 'components';
class LandingPage extends Component {
constructor(props) {
super(props);
this.state = { containerHeight: window.innerHeight };
this.handleResize = this.handleResize.bind(this);
}
export default () => next => action => {
const callAPI = action[CALL_API];
if (typeof callAPI === 'undefined') {
return next(action);
}
const { url, types } = callAPI;
// const url = action.url;
// const types = action.types;
const [requestType, successType, failureType] = types;
const myActionCreator = (actionType, payloadCreator) => {
return {
type: actionType,
payload: payloadCreator
};
}
const myPayloadCreator = (input) => {
return API.makeApiCall(input);
}
// Framework Imports
import 'babel-polyfill';
import { Application } from 'reductor';
import React from 'react';
import { Route, IndexRedirect } from 'react-router';
// Constants for Developmen purposes
const ENV = process.env.NODE_ENV || 'development';
const DevTools = window.devToolsExtension ? window.devToolsExtension() : f => f;
import { Module } from 'reductor';
import {
InitSessionAction,
InitSessionReducer,
InitSessionPayloadCreator,
} from './actions/InitSession';
import {
UserLoginAction,
function fizzbuzz(number) {
if( number%15 == 0 ) return "fizzbuzz";
if( number%3 == 0 ) return "fizz";
if( number%5 == 0 ) return "buzz";
return number;
}
for (let i = 0; i <= 100; i++) {
return fizzbuzz(i);
}
{code}
var now = new Date();
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
import React from 'react';
import { useAddonState } from '@storybook/api';
import { ADDON_ID, INITIAL_STATE, MOSSIO_THEME } from './shared';
import { ThemeProvider } from 'emotion-theming';
const withBranding = storyFn => {
const [{ brandPrimary, brandSecondary }] = useAddonState(ADDON_ID, INITIAL_STATE);
const branding = ancestorTheme => ({
...ancestorTheme,
import React from 'react';
import { useAddonState } from '@storybook/api';
import { ADDON_ID, INITIAL_STATE, MOSSIO_THEME } from './shared';
import { ThemeProvider } from 'emotion-theming';
const Branding = ({ story }) => {
const [{ brandPrimary, brandSecondary }] = useAddonState(ADDON_ID, INITIAL_STATE);
const branding = ancestorTheme => ({
...ancestorTheme,