This commit is contained in:
@@ -119,7 +119,7 @@ When `destroy()` is called (or when a new mount replaces an old one), everything
|
|||||||
## Complete Example
|
## Complete Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import 'sigpro';
|
import { $, mount } from 'sigpro';
|
||||||
|
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ h('div', {}, [
|
|||||||
|
|
||||||
### Tag shortcuts
|
### Tag shortcuts
|
||||||
|
|
||||||
Tag helpers are **not exported individually** from the core. To use them globally without the `h(...)` wrapper, activate the side‑effect module:
|
Tag helpers **are exported** from the core.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import "sigpro"
|
import "sigpro"
|
||||||
@@ -224,7 +224,7 @@ You never need to manually clean up – just write reactive code.
|
|||||||
## Full Example – Counter with Persistence
|
## Full Example – Counter with Persistence
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import 'sigpro';
|
import { $, mount } from 'sigpro';
|
||||||
|
|
||||||
const count = $(0, 'counter') // persists in localStorage
|
const count = $(0, 'counter') // persists in localStorage
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ If you want the router outlet to have no layout impact, you can set `display: co
|
|||||||
## Complete Example
|
## Complete Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import 'sigpro';
|
import { mount } from 'sigpro';
|
||||||
|
|
||||||
const Home = () => div("Welcome home");
|
const Home = () => div("Welcome home");
|
||||||
const About = () => div("About us");
|
const About = () => div("About us");
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ When you use the **IIFE bundle** (`sigpro.js` or `sigpro.min.js`) with a traditi
|
|||||||
```
|
```
|
||||||
|
|
||||||
### B. ESM (Modern JavaScript) – Explicit Activation
|
### B. ESM (Modern JavaScript) – Explicit Activation
|
||||||
**ES module** (`import { ... } from 'sigpro'`) or full `import 'sigpro'`.
|
**ES module** (`import { ... } from 'sigpro'`).
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import 'sigpro';
|
import { ... } from 'sigpro';
|
||||||
|
|
||||||
// Now you can use helpers globally
|
// Now you can use helpers globally
|
||||||
const App = () => div({ class: "app" }, "Ready!");
|
const App = () => div({ class: "app" }, "Ready!");
|
||||||
@@ -191,7 +191,7 @@ const Timer = () => {
|
|||||||
### ESM (modern projects)
|
### ESM (modern projects)
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import 'sigpro';
|
import { $, mount } from 'sigpro';
|
||||||
|
|
||||||
const nameSignal = $('');
|
const nameSignal = $('');
|
||||||
|
|
||||||
|
|||||||
@@ -51,11 +51,11 @@ Thanks to **SigPro's synchronous initialization**, you no longer need to wrap yo
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// src/main.js
|
// src/main.js
|
||||||
import SigPro from 'sigpro';
|
import { mount, router } from 'sigpro';
|
||||||
import { routes } from 'virtual:sigpro-routes';
|
import { routes } from 'virtual:sigpro-routes';
|
||||||
|
|
||||||
// The Core already has Router ready
|
// The Core already has Router ready
|
||||||
Mount(Router(routes), '#app');
|
mount(router(routes), '#app');
|
||||||
```
|
```
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user