Skip to content

Commit

Permalink
Version Packages (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Nov 22, 2024
1 parent a3e9af6 commit 10e9136
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 101 deletions.
13 changes: 0 additions & 13 deletions .changeset/old-chicken-grab.md

This file was deleted.

91 changes: 49 additions & 42 deletions packages/demo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# demo

## 1.3.3

### Patch Changes

- Updated dependencies [[`854718e`](https://github.com/dan-lee/timescape/commit/854718e4c98a2e6a1bff34bfa4b6c8b9e6f04680)]:
- [email protected]

## 1.3.2

### Patch Changes
Expand Down Expand Up @@ -91,32 +98,32 @@
Example usage (this works similar for all supported libraries):

```tsx
import { useTimescapeRange } from 'timescape/react'
import { useTimescapeRange } from "timescape/react";
// Use `createTimescapeRange` for Svelte

const { getRootProps, from, to } = useTimescapeRange({
from: { date: new Date('2000-01-01') },
from: { date: new Date("2000-01-01") },
to: { date: new Date() },
})
});

return (
<div {...getRootProps()}>
<div>
<input {...from.getInputProps('days')} />
<input {...from.getInputProps("days")} />
<span>/</span>
<input {...from.getInputProps('months')} />
<input {...from.getInputProps("months")} />
<span>/</span>
<input {...from.getInputProps('years')} />
<input {...from.getInputProps("years")} />
</div>
<div>
<input {...to.getInputProps('days')} />
<input {...to.getInputProps("days")} />
<span>/</span>
<input {...to.getInputProps('months')} />
<input {...to.getInputProps("months")} />
<span>/</span>
<input {...to.getInputProps('years')} />
<input {...to.getInputProps("years")} />
</div>
</div>
)
);
```

# Breaking changes
Expand All @@ -141,24 +148,24 @@
```tsx
const [options, setOptions] = useState({
date: new Date(),
})
const { ...rest } = useTimescape(options)
});
const { ...rest } = useTimescape(options);

const handleChange = () => {
setOptions((prev) => ({ ...prev, date: new Date() }))
}
setOptions((prev) => ({ ...prev, date: new Date() }));
};
```

<td>

```tsx
const { options, update, ...rest } = useTimescape({
date: new Date(),
})
});

const handleChange = () => {
update((prev) => ({ ...prev, date: new Date() }))
}
update((prev) => ({ ...prev, date: new Date() }));
};
```

</table>
Expand All @@ -177,30 +184,30 @@
<td>

```tsx
const options = useSignal({ date: new Date() })
const { ...rest } = useTimescape(options)
const options = useSignal({ date: new Date() });
const { ...rest } = useTimescape(options);

const handleChange = () => {
options.value = {
...options.value,
date: new Date(),
}
}
};
};
```

<td>

```tsx
const { options, ...rest } = useTimescape({
date: new Date(),
})
});

const handleChange = () => {
options.value = {
...options.value,
date: new Date(),
}
}
};
};
```

</table>
Expand All @@ -220,30 +227,30 @@
```tsx
const options = writable({
date: new Date(),
})
const { ...rest } = useTimescape(options)
});
const { ...rest } = useTimescape(options);

const handleChange = () => {
options.update((options) => ({
...options,
date: new Date(),
}))
}
}));
};
```

<td>

```tsx
const { options, ...rest } = useTimescape({
date: new Date(),
})
});

const handleChange = () => {
options.update((options) => ({
...options,
date: new Date(),
}))
}
}));
};
```

</table>
Expand All @@ -262,26 +269,26 @@
```tsx
const [options, setOptions] = createSignal({
date: new Date(),
})
const { ...rest } = useTimescape(options)
});
const { ...rest } = useTimescape(options);

const handleChange = () => {
setOptions('date', new Date())
setOptions("date", new Date());
// or object notation: setOptions({ … })
}
};
```

<td>

```tsx
const { options, update, ...rest } = useTimescape({
date: new Date(),
})
});

const handleChange = () => {
update('date', new Date())
update("date", new Date());
// or object notation: update({ … })
}
};
```

</table>
Expand All @@ -298,9 +305,9 @@
<td>

```tsx
const date = ref(new Date())
const options = reactive({ date })
const { ...rest } = useTimescape(options)
const date = ref(new Date());
const options = reactive({ date });
const { ...rest } = useTimescape(options);

// Set later:
// <button @click="date = new Date()">
Expand All @@ -311,7 +318,7 @@
```tsx
const { options, ...rest } = useTimescape({
date: new Date(),
})
});

// Set later:
// <button @click="options.date = new Date()">
Expand Down
2 changes: 1 addition & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "demo",
"version": "1.3.2",
"version": "1.3.3",
"type": "module",
"scripts": {
"typecheck": "tsc --noEmit",
Expand Down
Loading

0 comments on commit 10e9136

Please sign in to comment.