Skip to content

Commit 6f51bf4

Browse files
committed
fix docs
1 parent b6b05b4 commit 6f51bf4

12 files changed

+75
-75
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export const hooks: IHooks = {
169169
### Create your page components
170170

171171
```tsx
172-
import { Children, createNode, IPage, JSXElements, srouter, State, VNode } from "../../../src";
172+
import { Children, h, IPage, JSXElements, srouter, State, VNode } from "../../../src";
173173

174174
interface IShow {
175175
value: string;
@@ -203,10 +203,10 @@ function Show({value, onGo}: IShow, children: Children) {
203203
export const page5 = new page5();
204204
```
205205

206-
**Note:** you need to export the singleton of the class and always import `createNode` to render the views
206+
**Note:** you need to export the singleton of the class and always import `h` to render the views
207207

208208
To know more about the views see more in [ultradom](https://github.com/jorgebucaran/ultradom).
209-
All the ultradom functionalities like `patch`, `createNode` etc... are available in spiel-client
209+
All the ultradom functionalities like `patch`, `h` etc... are available in spiel-client
210210

211211
### Config your project
212212

@@ -225,7 +225,7 @@ This is a tsconfig example:
225225
"outDir": "./lib",
226226
"rootDir": ".",
227227
"jsx": "react",
228-
"jsxFactory": "createNode"
228+
"jsxFactory": "h"
229229
},
230230
"include": [
231231
"./src",
@@ -237,14 +237,14 @@ This is a tsconfig example:
237237
}
238238
```
239239

240-
Remember always to put `createNode` in the `jsxFactory` option.
240+
Remember always to put `h` in the `jsxFactory` option.
241241

242242
### Test your code
243243

244244
Create your mocks:
245245

246246
```tsx
247-
import { Children, createNode, IPage, JSXElements, State, VNode } from "../../src";
247+
import { Children, h, IPage, JSXElements, State, VNode } from "../../src";
248248

249249
interface IShow {
250250
value: string;
@@ -281,14 +281,14 @@ and your file spec:
281281

282282
```typescript
283283
import { assert, expect } from "chai";
284-
import { createNode as u, patch, VNode} from "../../src";
284+
import { h, patch, VNode} from "../../src";
285285

286286
import {componentTest} from "./mocks";
287287

288288
describe("Component", () => {
289289
let nodes: VNode<any>;
290290
before(() => {
291-
nodes = u(componentTest.view, componentTest.state);
291+
nodes = h(componentTest.view, componentTest.state);
292292
});
293293
it("has to be created", () => {
294294
const text: any = nodes.children.find((node: any) => node.nodeName === "span");
@@ -320,7 +320,7 @@ tsconfig.json:
320320
"outDir": "./lib",
321321
"rootDir": ".",
322322
"jsx": "react",
323-
"jsxFactory": "createNode"
323+
"jsxFactory": "h"
324324
},
325325
"include": [
326326
"./src",

READMEAPI.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export const hooks: IHooks = {
161161
### Create your page components
162162

163163
```tsx
164-
import { Children, createNode, IPage, JSXElements, srouter, State, VNode } from "../../../src";
164+
import { Children, h, IPage, JSXElements, srouter, State, VNode } from "../../../src";
165165

166166
interface IShow {
167167
value: string;
@@ -195,10 +195,10 @@ function Show({value, onGo}: IShow, children: Children) {
195195
export const page5 = new page5();
196196
```
197197

198-
**Note:** you need to export the singleton of the class and always import `createNode` to render the views
198+
**Note:** you need to export the singleton of the class and always import `h` to render the views
199199

200200
To know more about the views see more in [ultradom](https://github.com/jorgebucaran/ultradom).
201-
All the ultradom functionalities like `patch`, `createNode` etc... are available in spiel-client
201+
All the ultradom functionalities like `patch`, `h` etc... are available in spiel-client
202202

203203
### Config your project
204204

@@ -217,7 +217,7 @@ This is a tsconfig example:
217217
"outDir": "./lib",
218218
"rootDir": ".",
219219
"jsx": "react",
220-
"jsxFactory": "createNode"
220+
"jsxFactory": "h"
221221
},
222222
"include": [
223223
"./src",
@@ -229,14 +229,14 @@ This is a tsconfig example:
229229
}
230230
```
231231

232-
Remember always to put `createNode` in the `jsxFactory` option.
232+
Remember always to put `h` in the `jsxFactory` option.
233233

234234
### Test your code
235235

236236
Create your mocks:
237237

238238
```typescript
239-
import { Children, createNode, IPage, JSXElements, State, VNode } from "../../src";
239+
import { Children, h, IPage, JSXElements, State, VNode } from "../../src";
240240

241241
interface IShow {
242242
value: string;
@@ -273,14 +273,14 @@ and your file spec:
273273

274274
```typescript
275275
import { assert, expect } from "chai";
276-
import { createNode as u, patch, VNode} from "../../src";
276+
import { h, patch, VNode} from "../../src";
277277

278278
import {componentTest} from "./mocks";
279279

280280
describe("Component", () => {
281281
let nodes: VNode<any>;
282282
before(() => {
283-
nodes = u(componentTest.view, componentTest.state);
283+
nodes = h(componentTest.view, componentTest.state);
284284
});
285285
it("has to be created", () => {
286286
const text: any = nodes.children.find((node: any) => node.nodeName === "span");
@@ -312,7 +312,7 @@ tsconfig.json:
312312
"outDir": "./lib",
313313
"rootDir": ".",
314314
"jsx": "react",
315-
"jsxFactory": "createNode"
315+
"jsxFactory": "h"
316316
},
317317
"include": [
318318
"./src",

docs/classes/_router_.router.html

+18-18
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> config<wbr>Routers</h3>
133133
<div class="tsd-signature tsd-kind-icon">config<wbr>Routers<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_helpers_interfaces_.iconfigrouters.html" class="tsd-signature-type">IConfigRouters</a></div>
134134
<aside class="tsd-sources">
135135
<ul>
136-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L19">router.ts:19</a></li>
136+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L19">router.ts:19</a></li>
137137
</ul>
138138
</aside>
139139
</section>
@@ -143,7 +143,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> default<wbr>Props</h3>
143143
<div class="tsd-signature tsd-kind-icon">default<wbr>Props<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
144144
<aside class="tsd-sources">
145145
<ul>
146-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L18">router.ts:18</a></li>
146+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L18">router.ts:18</a></li>
147147
</ul>
148148
</aside>
149149
</section>
@@ -153,7 +153,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> element</h3>
153153
<div class="tsd-signature tsd-kind-icon">element<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Element</span></div>
154154
<aside class="tsd-sources">
155155
<ul>
156-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L23">router.ts:23</a></li>
156+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L23">router.ts:23</a></li>
157157
</ul>
158158
</aside>
159159
</section>
@@ -163,7 +163,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> hash</h3>
163163
<div class="tsd-signature tsd-kind-icon">hash<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
164164
<aside class="tsd-sources">
165165
<ul>
166-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L21">router.ts:21</a></li>
166+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L21">router.ts:21</a></li>
167167
</ul>
168168
</aside>
169169
</section>
@@ -173,7 +173,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> root</h3>
173173
<div class="tsd-signature tsd-kind-icon">root<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
174174
<aside class="tsd-sources">
175175
<ul>
176-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L22">router.ts:22</a></li>
176+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L22">router.ts:22</a></li>
177177
</ul>
178178
</aside>
179179
</section>
@@ -183,7 +183,7 @@ <h3>router</h3>
183183
<div class="tsd-signature tsd-kind-icon">router<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Navigo</span></div>
184184
<aside class="tsd-sources">
185185
<ul>
186-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L17">router.ts:17</a></li>
186+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L17">router.ts:17</a></li>
187187
</ul>
188188
</aside>
189189
<div class="tsd-comment tsd-typography">
@@ -207,7 +207,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> use<wbr>Hash</h3>
207207
<div class="tsd-signature tsd-kind-icon">use<wbr>Hash<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
208208
<aside class="tsd-sources">
209209
<ul>
210-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L20">router.ts:20</a></li>
210+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L20">router.ts:20</a></li>
211211
</ul>
212212
</aside>
213213
</section>
@@ -224,7 +224,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> build</h3>
224224
<li class="tsd-description">
225225
<aside class="tsd-sources">
226226
<ul>
227-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L100">router.ts:100</a></li>
227+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L100">router.ts:100</a></li>
228228
</ul>
229229
</aside>
230230
<h4 class="tsd-parameters-title">Parameters</h4>
@@ -250,7 +250,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> check<wbr>Default</h3>
250250
<li class="tsd-description">
251251
<aside class="tsd-sources">
252252
<ul>
253-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L170">router.ts:170</a></li>
253+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L170">router.ts:170</a></li>
254254
</ul>
255255
</aside>
256256
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@@ -267,7 +267,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> check<wbr>Not<wbr>Found
267267
<li class="tsd-description">
268268
<aside class="tsd-sources">
269269
<ul>
270-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L158">router.ts:158</a></li>
270+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L158">router.ts:158</a></li>
271271
</ul>
272272
</aside>
273273
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@@ -284,7 +284,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> check<wbr>Query</h3>
284284
<li class="tsd-description">
285285
<aside class="tsd-sources">
286286
<ul>
287-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L136">router.ts:136</a></li>
287+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L136">router.ts:136</a></li>
288288
</ul>
289289
</aside>
290290
<h4 class="tsd-parameters-title">Parameters</h4>
@@ -307,7 +307,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> check<wbr>State</h3>
307307
<li class="tsd-description">
308308
<aside class="tsd-sources">
309309
<ul>
310-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L144">router.ts:144</a></li>
310+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L144">router.ts:144</a></li>
311311
</ul>
312312
</aside>
313313
<h4 class="tsd-parameters-title">Parameters</h4>
@@ -333,7 +333,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> create<wbr>Root<wbr>Ele
333333
<li class="tsd-description">
334334
<aside class="tsd-sources">
335335
<ul>
336-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L87">router.ts:87</a></li>
336+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L87">router.ts:87</a></li>
337337
</ul>
338338
</aside>
339339
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@@ -350,7 +350,7 @@ <h3>go</h3>
350350
<li class="tsd-description">
351351
<aside class="tsd-sources">
352352
<ul>
353-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L59">router.ts:59</a></li>
353+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L59">router.ts:59</a></li>
354354
</ul>
355355
</aside>
356356
<div class="tsd-comment tsd-typography">
@@ -402,7 +402,7 @@ <h3>resolve</h3>
402402
<li class="tsd-description">
403403
<aside class="tsd-sources">
404404
<ul>
405-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L72">router.ts:72</a></li>
405+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L72">router.ts:72</a></li>
406406
</ul>
407407
</aside>
408408
<div class="tsd-comment tsd-typography">
@@ -435,7 +435,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> set<wbr>Patch</h3>
435435
<li class="tsd-description">
436436
<aside class="tsd-sources">
437437
<ul>
438-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L123">router.ts:123</a></li>
438+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L123">router.ts:123</a></li>
439439
</ul>
440440
</aside>
441441
<h4 class="tsd-parameters-title">Parameters</h4>
@@ -464,7 +464,7 @@ <h3>set<wbr>Routers</h3>
464464
<li class="tsd-description">
465465
<aside class="tsd-sources">
466466
<ul>
467-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L31">router.ts:31</a></li>
467+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L31">router.ts:31</a></li>
468468
</ul>
469469
</aside>
470470
<div class="tsd-comment tsd-typography">
@@ -501,7 +501,7 @@ <h3>update<wbr>Page<wbr>Links</h3>
501501
<li class="tsd-description">
502502
<aside class="tsd-sources">
503503
<ul>
504-
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/4fa4dd4/src/router.ts#L83">router.ts:83</a></li>
504+
<li>Defined in <a href="https://github.com/spieljs/spiel-client/blob/b6b05b4/src/router.ts#L83">router.ts:83</a></li>
505505
</ul>
506506
</aside>
507507
<div class="tsd-comment tsd-typography">

docs/index.html

+9-9
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ <h4 id="and-your-hooks-for-expecific-route-">And your hooks for expecific route:
204204
};
205205
</code></pre>
206206
<h3 id="create-your-page-components">Create your page components</h3>
207-
<pre><code class="lang-tsx">import { Children, createNode, IPage, JSXElements, srouter, State, VNode } from &quot;../../../src&quot;;
207+
<pre><code class="lang-tsx">import { Children, h, IPage, JSXElements, srouter, State, VNode } from &quot;../../../src&quot;;
208208

209209
interface IShow {
210210
value: string;
@@ -237,9 +237,9 @@ <h3 id="create-your-page-components">Create your page components</h3>
237237

238238
export const page5 = new page5();
239239
</code></pre>
240-
<p><strong>Note:</strong> you need to export the singleton of the class and always import <code>createNode</code> to render the views</p>
240+
<p><strong>Note:</strong> you need to export the singleton of the class and always import <code>h</code> to render the views</p>
241241
<p>To know more about the views see more in <a href="https://github.com/jorgebucaran/ultradom">ultradom</a>.
242-
All the ultradom functionalities like <code>patch</code>, <code>createNode</code> etc... are available in spiel-client</p>
242+
All the ultradom functionalities like <code>patch</code>, <code>h</code> etc... are available in spiel-client</p>
243243
<h3 id="config-your-project">Config your project</h3>
244244
<p>This is a tsconfig example:</p>
245245
<pre><code class="lang-typescript">{
@@ -254,7 +254,7 @@ <h3 id="config-your-project">Config your project</h3>
254254
<span class="hljs-string">"outDir"</span>: <span class="hljs-string">"./lib"</span>,
255255
<span class="hljs-string">"rootDir"</span>: <span class="hljs-string">"."</span>,
256256
<span class="hljs-string">"jsx"</span>: <span class="hljs-string">"react"</span>,
257-
<span class="hljs-string">"jsxFactory"</span>: <span class="hljs-string">"createNode"</span>
257+
<span class="hljs-string">"jsxFactory"</span>: <span class="hljs-string">"h"</span>
258258
},
259259
<span class="hljs-string">"include"</span>: [
260260
<span class="hljs-string">"./src"</span>,
@@ -265,10 +265,10 @@ <h3 id="config-your-project">Config your project</h3>
265265
]
266266
}
267267
</code></pre>
268-
<p>Remember always to put <code>createNode</code> in the <code>jsxFactory</code> option.</p>
268+
<p>Remember always to put <code>h</code> in the <code>jsxFactory</code> option.</p>
269269
<h3 id="test-your-code">Test your code</h3>
270270
<p>Create your mocks:</p>
271-
<pre><code class="lang-typescript">import { Children, createNode, IPage, JSXElements, State, VNode } from "../../src";
271+
<pre><code class="lang-typescript">import { Children, h, IPage, JSXElements, State, VNode } from "../../src";
272272

273273
interface IShow {
274274
value: string;
@@ -302,14 +302,14 @@ <h3 id="test-your-code">Test your code</h3>
302302
</code></pre>
303303
<p>and your file spec:</p>
304304
<pre><code class="lang-typescript"><span class="hljs-keyword">import</span> { assert, expect } <span class="hljs-keyword">from</span> <span class="hljs-string">"chai"</span>;
305-
<span class="hljs-keyword">import</span> { createNode <span class="hljs-keyword">as</span> u, patch, VNode} <span class="hljs-keyword">from</span> <span class="hljs-string">"../../src"</span>;
305+
<span class="hljs-keyword">import</span> { h, patch, VNode} <span class="hljs-keyword">from</span> <span class="hljs-string">"../../src"</span>;
306306

307307
<span class="hljs-keyword">import</span> {componentTest} <span class="hljs-keyword">from</span> <span class="hljs-string">"./mocks"</span>;
308308

309309
describe(<span class="hljs-string">"Component"</span>, <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
310310
<span class="hljs-keyword">let</span> nodes: VNode&lt;<span class="hljs-built_in">any</span>&gt;;
311311
before(<span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
312-
nodes = u(componentTest.view, componentTest.state);
312+
nodes = h(componentTest.view, componentTest.state);
313313
});
314314
it(<span class="hljs-string">"has to be created"</span>, <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
315315
<span class="hljs-keyword">const</span> text: <span class="hljs-built_in">any</span> = nodes.children.find(<span class="hljs-function">(<span class="hljs-params">node: <span class="hljs-built_in">any</span></span>) =&gt;</span> node.nodeName === <span class="hljs-string">"span"</span>);
@@ -337,7 +337,7 @@ <h2 id="make-compatible-with-es5-browsers">Make compatible with ES5 browsers</h2
337337
<span class="hljs-attr">"outDir"</span>: <span class="hljs-string">"./lib"</span>,
338338
<span class="hljs-attr">"rootDir"</span>: <span class="hljs-string">"."</span>,
339339
<span class="hljs-attr">"jsx"</span>: <span class="hljs-string">"react"</span>,
340-
<span class="hljs-attr">"jsxFactory"</span>: <span class="hljs-string">"createNode"</span>
340+
<span class="hljs-attr">"jsxFactory"</span>: <span class="hljs-string">"h"</span>
341341
},
342342
<span class="hljs-attr">"include"</span>: [
343343
<span class="hljs-string">"./src"</span>,

0 commit comments

Comments
 (0)