|
| 1 | +import Head from 'next/head' |
| 2 | + |
| 3 | +export default function Home() { |
| 4 | + return ( |
| 5 | + <> |
| 6 | + <Head> |
| 7 | + <title>PostHog State Management Examples</title> |
| 8 | + <meta name="description" content="Compare PostHog logging with Redux vs Kea" /> |
| 9 | + <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 10 | + <link rel="icon" href="/favicon.ico" /> |
| 11 | + </Head> |
| 12 | + <div className="container"> |
| 13 | + <h1>PostHog State Management Examples</h1> |
| 14 | + <p style={{ textAlign: 'center', color: '#666', marginBottom: '2rem' }}> |
| 15 | + Compare PostHog logging with different state management libraries |
| 16 | + </p> |
| 17 | + |
| 18 | + <div style={{ display: 'flex', gap: '20px', justifyContent: 'center', flexWrap: 'wrap' }}> |
| 19 | + <div className="example-card"> |
| 20 | + <h3>Redux Example</h3> |
| 21 | + <p> |
| 22 | + Todo list with Redux Toolkit and <code>posthogReduxLogger</code> |
| 23 | + </p> |
| 24 | + <ul style={{ textAlign: 'left', margin: '1rem 0' }}> |
| 25 | + <li>Redux Toolkit store</li> |
| 26 | + <li>Middleware integration</li> |
| 27 | + <li>Action/state masking</li> |
| 28 | + <li>Rate limiting</li> |
| 29 | + <li>Performance monitoring</li> |
| 30 | + </ul> |
| 31 | + <a href="/redux" className="example-button"> |
| 32 | + Try Redux Version → |
| 33 | + </a> |
| 34 | + </div> |
| 35 | + |
| 36 | + <div className="example-card"> |
| 37 | + <h3>Kea Example</h3> |
| 38 | + <p> |
| 39 | + Todo list with Kea and <code>posthogKeaLogger</code> |
| 40 | + </p> |
| 41 | + <ul style={{ textAlign: 'left', margin: '1rem 0' }}> |
| 42 | + <li>Kea logic stores</li> |
| 43 | + <li>Plugin integration</li> |
| 44 | + <li>Cleaner API (maskAction/maskState)</li> |
| 45 | + <li>Same rate limiting & features</li> |
| 46 | + <li>Performance monitoring</li> |
| 47 | + </ul> |
| 48 | + <a href="/kea" className="example-button"> |
| 49 | + Try Kea Version → |
| 50 | + </a> |
| 51 | + </div> |
| 52 | + </div> |
| 53 | + |
| 54 | + <div |
| 55 | + style={{ |
| 56 | + marginTop: '3rem', |
| 57 | + padding: '1.5rem', |
| 58 | + background: '#f8f9fa', |
| 59 | + borderRadius: '8px', |
| 60 | + border: '1px solid #e9ecef', |
| 61 | + }} |
| 62 | + > |
| 63 | + <h4 style={{ marginBottom: '1rem', color: '#333' }}>🧑💻 Developer Notes</h4> |
| 64 | + <ul style={{ textAlign: 'left', color: '#666' }}> |
| 65 | + <li> |
| 66 | + <strong>Console Logging:</strong> Open browser dev tools to see PostHog action logging |
| 67 | + </li> |
| 68 | + <li> |
| 69 | + <strong>API Comparison:</strong> Redux uses <code>maskReduxAction</code>/ |
| 70 | + <code>maskReduxState</code> |
| 71 | + </li> |
| 72 | + <li> |
| 73 | + <strong>Kea Cleaner API:</strong> Kea uses <code>maskAction</code>/<code>maskState</code> |
| 74 | + </li> |
| 75 | + <li> |
| 76 | + <strong>Same Features:</strong> Both support rate limiting, state diffing, and performance |
| 77 | + monitoring |
| 78 | + </li> |
| 79 | + <li> |
| 80 | + <strong>Integration:</strong> Kea logger reuses Redux logger internally via middleware |
| 81 | + injection |
| 82 | + </li> |
| 83 | + </ul> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + </> |
| 87 | + ) |
| 88 | +} |
0 commit comments