This file contains 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 rewiremock from 'rewiremock'; | |
import sinon from 'sinon'; | |
rewiremock('./rocket-silo') | |
.with({ Launch: sinon.stub()}); | |
rewiremock('./rockets') | |
.toBeUsed(); | |
// .... |
This file contains 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 rewiremock from 'rewiremock'; | |
import sinon from 'sinon'; | |
const Launch = sinon.stub() | |
const case = rewiremock.proxy('./dooms-day.js',{ | |
'./rocket-silo': rewiremock.with({Launch}).toBeUsed(), | |
'doom-scheduler': rewiremock.by('mocked-doom-scheduler') | |
}); |
This file contains 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 rewiremock from 'rewiremock'; | |
import sinon from 'sinon'; | |
const Launch = sinon.stub() | |
// "require" module name | |
rewiremock(() => require('./rocket-silo')).with({ | |
Launch: sinon.stub() | |
}); |
This file contains 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
// base - https://github.com/reactjs/rfcs/pull/40#discussion_r180818891 | |
import memoize from "lodash.memoize"; | |
class Example { | |
getSortedData = memoize((list, sortFn) => list.slice().sort(sortFn)) | |
getPagedData = memoize((list, page) => list.slice(page*10, (page+1)*10)) | |
render() { | |
const sorted = this.getSortedData(this.props.data, this.props.sort); | |
const pages = this.getPagedData(sorted, this.props.page); |
This file contains 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
// base - https://github.com/reactjs/rfcs/pull/40#discussion_r180818891 | |
import memoize from "lodash.memoize"; | |
import flow from "lodash.flow"; | |
class Example { | |
getSortedData = memoize((list, sortFn) => list.slice().sort(sortFn)) | |
getPagedData = memoize((list, page) => list.slice(page*10, (page+1)*10)) | |
render() { | |
const theFlow = flow( |
This file contains 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
// base - https://github.com/reactjs/rfcs/pull/40#discussion_r180818891 | |
import {MemoizedFlow} from "react-memoize"; | |
class Example { | |
getSortedData = (list, sortFn) => list.slice().sort(sortFn) | |
getPagedData = (list, page) => list.slice(page*10, (page+1)*10)) | |
render() { | |
return ( | |
<MemoizedFlow |
This file contains 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 Locky from 'react-locky'; | |
import FocusLock from 'react-focus-lock'; | |
const LockedModal = () => ( | |
<Modal> | |
<Locky> | |
// it is important to manage focus, to not let "tab-out", as long you will be unable to "tab-in" | |
<FocusLock> | |
Hey! You can only click on this button! | |
<button> click me </button> |
This file contains 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 Locky from 'react-locky'; | |
const LockedModal = () => ( | |
// lock only scroll | |
<Locky noDefault events={{scroll:true}}> | |
// we are locking scroll only. There is no need to focus lock | |
Hey! You can only scroll only here | |
<div> scroll me </div> | |
</Locky> | |
) |
This file contains 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
#include "stdafx.h" | |
#include "l2_lapd.h" | |
@require "mpx.lua" | |
@include "../siglib/sys_signals.hh" | |
#include "../siglib/release_types.h" | |
//lua function RR(a)return a;end; | |
//lua function CL(a)return a;end; | |
#define CS_CALL_CLEAR 0 |
This file contains 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 lightMachine = Machine({ | |
key: 'light', | |
initial: 'green', | |
states: { | |
green: { | |
on: { | |
TIMER: 'yellow', | |
} | |
}, |