UNPKG

organism-react-scroll-nav

Version:
38 lines 1.9 kB
import _objectSpread from "reshow-runtime/es/helpers/objectSpread2"; import _classCallCheck from "reshow-runtime/es/helpers/classCallCheck"; import _createClass from "reshow-runtime/es/helpers/createClass"; import _possibleConstructorReturn from "reshow-runtime/es/helpers/possibleConstructorReturn"; import _isNativeReflectConstruct from "reshow-runtime/es/helpers/isNativeReflectConstruct"; import _getPrototypeOf from "reshow-runtime/es/helpers/getPrototypeOf"; import _inherits from "reshow-runtime/es/helpers/inherits"; import _defineProperty from "reshow-runtime/es/helpers/defineProperty"; function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } import { ImmutableStore } from "reshow-flux"; import { Scroller } from "./scrollStore.mjs"; var FastScroller = /*#__PURE__*/function (_Scroller) { function FastScroller() { var _this; _classCallCheck(this, FastScroller); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _callSuper(this, FastScroller, [].concat(args)); _defineProperty(_this, "storeName", "fastScroll"); return _this; } _inherits(FastScroller, _Scroller); return _createClass(FastScroller, [{ key: "runScrollMonitor", value: function runScrollMonitor(e) { this.triggerScroll(e.target); } }]); }(Scroller); var oFastScroller = new FastScroller(); var [store, fastScrollDispatch] = ImmutableStore(oFastScroller.reduce.bind(oFastScroller), oFastScroller.getInitialState.bind(oFastScroller)); var scrollStore = _objectSpread(_objectSpread({}, store), {}, { scroller: oFastScroller }); oFastScroller.dispatch = fastScrollDispatch; oFastScroller.store = store; export default scrollStore;