Skip to content

Commit

Permalink
fix(Devtools): use correct verifyStrictRender option
Browse files Browse the repository at this point in the history
  • Loading branch information
christianalfoni committed Nov 8, 2016
1 parent 488b21a commit 17e2f3b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/cerebral/src/Controller.js
Expand Up @@ -102,7 +102,7 @@ class Controller extends EventEmitter {
componentsToRender = this.componentDependencyStore.getAllUniqueEntities()
} else if (this.options.strictRender) {
componentsToRender = this.componentDependencyStore.getStrictUniqueEntities(changes)
if (this.devtools) {
if (this.devtools && this.devtools.verifyStrictRender) {
verifyStrictRender(changes, this.componentDependencyStore.map)
}
} else {
Expand Down
15 changes: 10 additions & 5 deletions packages/cerebral/src/devtools/index.js
Expand Up @@ -10,14 +10,19 @@ const VERSION = 'v1'
- Stores data related to time travel, if activated
*/
class Devtools {
constructor (options = {storeMutations: true, preventExternalMutations: true, enforceSerializable: true, verifyStrictRender: true}) {
constructor (options = {
storeMutations: true,
preventExternalMutations: true,
enforceSerializable: true,
verifyStrictRender: true
}) {
this.VERSION = VERSION
this.debuggerComponentsMap = {}
this.debuggerComponentDetailsId = 1
this.storeMutations = options.storeMutations
this.preventExternalMutations = options.preventExternalMutations
this.enforceSerializable = options.enforceSerializable
this.strictPathReplaceError = options.verifyStrictRender
this.storeMutations = Boolean(options.storeMutations)
this.preventExternalMutations = Boolean(options.preventExternalMutations)
this.enforceSerializable = Boolean(options.enforceSerializable)
this.verifyStrictRender = Boolean(options.verifyStrictRender)
this.backlog = []
this.mutations = []
this.latestExecutionId = null
Expand Down
2 changes: 1 addition & 1 deletion packages/cerebral/src/react/react.test.js
Expand Up @@ -497,7 +497,7 @@ describe('React', () => {
it('should throw error with devtools when replacing path, causing render not to happen', () => {
const controller = Controller({
options: {strictRender: true},
devtools: {init () {}, send () {}, updateComponentsMap () {}},
devtools: {verifyStrictRender: true, init () {}, send () {}, updateComponentsMap () {}},
state: {
foo: {
bar: 'baz'
Expand Down

0 comments on commit 17e2f3b

Please sign in to comment.