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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: "stable", |
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
class FormWithSomeCouponInput extends React.Component { | |
constructor(props) { ... } | |
handleCouponBlur() { | |
const { coupon, actions } = this.props; | |
actions.applyBlur('coupon'); | |
actions.submitCoupon({ coupon }); | |
} |
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
class FormWithSomeCouponInput extends React.Component { | |
constructor(props) { ... } | |
handleCouponBlur() { | |
const { coupon, actions } = this.props; | |
actions.applyBlur('coupon'); | |
actions.submitCoupon({ coupon }); | |
} |
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
class FormWithSomeCouponInput extends React.Component { | |
constructor(props) { ... } | |
handleSubmitCoupon() { | |
const { coupon, actions } = this.props; | |
actions.submitCoupon({ coupon }); | |
} | |
handleCouponBlur() { |
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 thisApiMw from './thisApiMw' | |
import thatApiMw from './thatApiMw' | |
import someApiMw from './someApiMw' | |
const mws = { | |
thisApiMw, | |
thatApiMw, | |
someApiMw | |
} |
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
// Returns 'a' middleware | |
const combineMiddlewares = (...middlewares) => store => { | |
// Map over applying store | |
const stored = middlewares.map(mw => mw(store)) | |
return next => { | |
// Map over applying the next as 'next' | |
const [first, ...rest] = stored | |
const nextMiddlewares = [...rest, next] | |
// Should this be done in reverse? | |
// (apply 'next', then through the chain & mutate locally?) |
NewerOlder