causalityjs
Advanced tools
Comparing version
@@ -18,2 +18,3 @@ import { argumentsToArray, configSignature, mergeInto } from "./lib/utility.js"; | ||
requireInvalidatorName: false, | ||
warnOnNestedRepeater: true, | ||
@@ -173,2 +174,3 @@ objectMetaProperty: "causality", | ||
requireInvalidatorName, | ||
warnOnNestedRepeater, | ||
objectMetaProperty, | ||
@@ -1133,2 +1135,11 @@ emitEvents, | ||
if( warnOnNestedRepeater && state.inActiveRecording ){ | ||
let parentDesc = state.context.description; | ||
if( !parentDesc && state.context.parent ) parentDesc = state.context.parent.description; | ||
if( !parentDesc ){ | ||
parentDesc = 'unnamed'; | ||
} | ||
console.warn(Error(`repeater ${description||'unnamed'} inside active recording ${parentDesc}`)); | ||
} | ||
// Activate! | ||
@@ -1135,0 +1146,0 @@ const repeater = createRepeater(description, repeaterAction, repeaterNonRecordingAction, options, finishRebuilding); |
{ | ||
"name": "causalityjs", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "A library for reactive programming based on Javascript proxies.", | ||
@@ -5,0 +5,0 @@ "main": "causality.js", |
@@ -220,3 +220,7 @@ | ||
Observed object causality metadata are now gathered in a configurable property, defaulting to `causality`. `obj.__id` is now `obj.causality.id`. `obj.__target` is now `obj.causality.target`. | ||
Check if an object is an observable by checking for `obj.causality`. | ||
# React Integration | ||
@@ -223,0 +227,0 @@ |
'use strict'; | ||
require = require("esm")(module); | ||
const {observable, repeat, transaction, cachedCallCount} = require("../causality.js").getWorld(); | ||
const {observable, repeat, transaction, cachedCallCount} = require("../causality.js").getWorld({warnOnNestedRepeater:false}); | ||
const assert = require('assert'); | ||
@@ -5,0 +5,0 @@ describe("Meta repeaters", function(){ |
199424
0.37%3486
0.29%249
1.63%