Skip to content

Commit cc1581b

Browse files
committed
New Data New bind
dd-model -> bind
1 parent bb23017 commit cc1581b

File tree

10 files changed

+13144
-104
lines changed

10 files changed

+13144
-104
lines changed

examples/dd-model/app.tsx renamed to examples/bind/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const view = (
1313
<div>
1414
<div>Hello, {don(path().hello)}</div>
1515
<div>
16-
<input type="text" dd-model="hello" />
16+
<input type="text" bind="hello" />
1717
</div>
1818
</div>
1919
);
File renamed without changes.

examples/pathifier-on/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const view = (
2222
<button id="desc" onClick={() => (data.desc = !data.desc)}>
2323
Toggle desc
2424
</button>
25-
<input type="text" placeholder="filter" dd-model="filter" />
25+
<input type="text" placeholder="filter" bind="filter" />
2626

2727
<ul>
2828
{don(path().users)

package-lock.json

Lines changed: 13065 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@
4848
"typescript": "^4.3.2"
4949
},
5050
"dependencies": {
51-
"@eirikb/data": "^5.0.1"
51+
"@eirikb/data": "^5.1.0"
5252
}
5353
}

readme.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Output:
306306

307307
### Automatic binding
308308

309-
[app.tsx](./examples/dd-model/app.tsx):
309+
[app.tsx](./examples/bind/app.tsx):
310310
```tsx
311311
interface Data {
312312
hello: string;
@@ -320,14 +320,14 @@ const view = (
320320
<div>
321321
<div>Hello, {don(path().hello)}</div>
322322
<div>
323-
<input type="text" dd-model="hello" />
323+
<input type="text" bind="hello" />
324324
</div>
325325
</div>
326326
);
327327
```
328328
Output:
329329

330-
![dd-model](readme/img/dd-model.gif)
330+
![bind](readme/img/bind.gif)
331331

332332
## Pathifier
333333

@@ -503,4 +503,3 @@ const view = (
503503
init(document.body, view);
504504
```
505505

506-

readme/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ ${await run('data-attributes', async ({ snapshot, page }) => {
130130
131131
### Automatic binding
132132
133-
${readCode('dd-model/app.tsx')}
133+
${readCode('bind/app.tsx')}
134134
Output:
135135
136-
${await run('dd-model', async ({ snapshot, page }) => {
136+
${await run('bind', async ({ snapshot, page }) => {
137137
await snapshot(1);
138138
await page.click('input', { clickCount: 3 });
139139
for (const c of 'there'.split('')) {

src/dd-props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default (
3535

3636
if (props) {
3737
const propsAsAny = props as any;
38-
const model = propsAsAny['dd-model'];
38+
const model = propsAsAny['bind'];
3939
if (model) {
4040
onChange((value: any) => data.set(model, value));
4141
let ref: string = '';

test/godmode.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ test('godMode 2', async t => {
4545
init(
4646
element,
4747
<div>
48-
{don('users.$.*').map(user => (
48+
{don('users.$.*').map<any>((user: any) => (
4949
<b>{user.name}</b>
5050
))}
5151
</div>
@@ -67,7 +67,7 @@ test('godMode 3', async t => {
6767
init(
6868
element,
6969
<div>
70-
{don('users.$.*').map(user => (
70+
{don('users.$.*').map((user: any) => (
7171
<b>{user.name}</b>
7272
))}
7373
</div>
@@ -88,7 +88,7 @@ test('godMode 4', async t => {
8888
init(
8989
element,
9090
<div>
91-
{don('users.$.*').map(user => (
91+
{don('users.$.*').map((user: any) => (
9292
<b>{user.name}</b>
9393
))}
9494
</div>

0 commit comments

Comments
 (0)