()
| 48 | const PassChildren: s.ParentComponent = props => props.children |
| 49 | |
| 50 | const Article: s.Component = () => { |
| 51 | |
| 52 | const state = createMutable({ |
| 53 | count: 0, |
| 54 | other: {name: 'article'}, |
| 55 | content: { |
| 56 | title: 'A cool headline for testing :)', |
| 57 | body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem odio culpa vel vitae? Quis deleniti soluta rem velit necessitatibus? ', |
| 58 | }, |
| 59 | }) |
| 60 | ;(state as any).circular = state |
| 61 | |
| 62 | const [data] = s.createResource( |
| 63 | () => state.count, |
| 64 | async c => { |
| 65 | await new Promise(r => setTimeout(r, 1000)) |
| 66 | return `Article ${c}` |
| 67 | }, |
| 68 | {name: 'resource'}, |
| 69 | ) |
| 70 | |
| 71 | return ( |
| 72 | <article> |
| 73 | <h3>{state.content.title}</h3> |
| 74 | <p> |
| 75 | {state.content.body} |
| 76 | <b> |
| 77 | Saepe nulla omnis nobis minima perferendis odio doloremque deleniti dolore |
| 78 | corrupti. |
| 79 | </b> |
| 80 | </p> |
| 81 | {/* <p>Count: {state.count}</p> */} |
| 82 | <s.Suspense> |
| 83 | <p> |
| 84 | <PassChildren> |
| 85 | <button onClick={() => state.count++}>Increment {data()}</button> |
| 86 | </PassChildren> |
| 87 | </p> |
| 88 | </s.Suspense> |
| 89 | </article> |
| 90 | ) |
| 91 | } |
| 92 | |
| 93 | const DynamicSpreadParent = () => { |
| 94 | const [props, setProps] = s.createSignal<any>({ |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…