This file contains hidden or 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 { createAction } from 'redux-actions'; | |
| import { identity, isArray } from 'lodash'; | |
| import { SubmissionError } from 'redux-form'; | |
| export const PREFIX = '@@shelf'; | |
| export const statuses = ['START', 'SUCCESS', 'ERROR']; | |
| const getType = (status:string) => (name):string => `${PREFIX}/${status} -> ${name.toString()}` | |
| const createApiAction = (name, status) => createAction( |
This file contains hidden or 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
| window.findifyApiRegistry = [{ | |
| hook: "*.item", | |
| mapProps: function(props) { | |
| return { | |
| onClick: function(e) { | |
| e.preventDefault(); | |
| return props.onProductClick({ | |
| id: props.id, | |
| product_url: props.product_url // You can modify url | |
| }) |
This file contains hidden or 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
| window.findifyApiRegistry = [{ | |
| hook: '*facets', | |
| didMount: function(res){ | |
| var node = res.node; | |
| var props = res.data; | |
| var min = res.data.from; | |
| var max = res.data.to; | |
| var onChange = res.data.onChange; | |
| var slider = document.createElement('div'); | |
This file contains hidden or 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 path = require('path'); | |
| module.exports.createRules = (rules, initial = {}) => | |
| Object.keys(rules).reduce((acc, selector) => | |
| (acc[selector] = Object.assign( | |
| {}, | |
| acc[selector], | |
| rules[selector], | |
| { test: new RegExp(`/\.${selector}$\/`) }) | |
| ) && acc |
This file contains hidden or 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
| - block spread(fn) | |
| : args = [].slice.call(arguments, 1) | |
| {fn}.apply(this, [].slice.call(arguments).concat({args|json})) |
This file contains hidden or 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 { combineReducers } from "redux"; | |
| import { routerReducer } from "react-router-redux"; | |
| import { reducer as formReducer } from "redux-form"; | |
| import { Record, Map } from 'immutable'; | |
| const reducersCache = {}; | |
| class Test extends Record ({ | |
| item: 1 | |
| }){ |
This file contains hidden or 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 { Route } from 'react-router'; | |
| import isUndefined from 'lodash/isundefined'; | |
| import every from 'lodash/every'; | |
| import some from 'lodash/some'; | |
| const hasFeatures = (features, exposes) => | |
| isUndefined(exposes) || every(exposes, feature => features.includes(feature)); | |
| const hasAccess = ({ accesses }, mandatory, optional) => |
This file contains hidden or 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 { createReducer } from 'redux-act'; | |
| import isFunction from 'lodash/isFunction'; | |
| import isString from 'lodash/isString'; | |
| import isEmpty from 'lodash/isEmpty'; | |
| import withMessage from './withMessage'; | |
| import { connect } from 'react-redux'; | |
| import compose from 'recompose/compose'; | |
| import createEagerFactory from 'recompose/createEagerFactory'; | |
| import { asyncConnect } from 'redux-async-connect'; | |
| import { createSelector, createStructuredSelector } from 'reselect'; |
This file contains hidden or 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 { batchActions } from 'redux-batched-actions'; | |
| /** | |
| * Create a function which will handle error in request | |
| * and dispatch rest actions on success. | |
| * You can also use .then(data => ...) to do something on sucess | |
| * | |
| * @param Promised action | |
| * @param ... other actions |
This file contains hidden or 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
| { | |
| name: 'demo_front', | |
| target: 'web', | |
| node: { | |
| fs: 'empty' | |
| }, | |
| output: { | |
| publicPath: '/', | |
| filename: '[name].js', | |
| chunkFilename: 'chunk.[name].js', |