Skip to content

Commit

Permalink
chore: tweak changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Aug 23, 2024
1 parent 90dc3c1 commit 84638d3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["playground"]
"ignore": ["playground", "docs"]
}
50 changes: 24 additions & 26 deletions .changeset/empty-chairs-agree.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,31 @@
"@fn-sphere/filter": minor
---

### Minor Changes

- Deprecated `onPredicateChange` in `useFilterSphere`

### ⚠️ BREAKING CHANGES

- The `onRuleChange` callback in `useFilterSphere` now receives an object with both `filterRule` and `predicate` properties, instead of just the `filterRule`.
- The `onPredicateChange` callback has been removed. Use the `predicate` property in the `onRuleChange` callback instead.

```ts
export interface FilterSphereInput<Data> extends BasicFilterSphereInput<Data> {
onRuleChange?: (data: {
filterRule: FilterGroup;
predicate: (data: Data) => boolean;
}) => void;
}

const { context } = useFilterSphere({
schema: YOUR_DATA_SCHEMA,
onRuleChange: ({ predicate }) => {
const filteredData = YOUR_DATA.filter(predicate);
console.log(filteredData);
},
});
```

#### Migration Guide
- ⚠️ BREAKING CHANGES

- The `onRuleChange` callback in `useFilterSphere` now receives an object with both `filterRule` and `predicate` properties, instead of just the `filterRule`.
- The `onPredicateChange` callback has been removed. Use the `predicate` property in the `onRuleChange` callback instead.

```ts
export interface FilterSphereInput<Data>
extends BasicFilterSphereInput<Data> {
onRuleChange?: (data: {
filterRule: FilterGroup;
predicate: (data: Data) => boolean;
}) => void;
}

const { context } = useFilterSphere({
schema: YOUR_DATA_SCHEMA,
onRuleChange: ({ predicate }) => {
const filteredData = YOUR_DATA.filter(predicate);
console.log(filteredData);
},
});
```

- Migration Guide

```diff
const { context } = useFilterSphere({
Expand Down
14 changes: 8 additions & 6 deletions .changeset/heavy-walls-roll.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
"@fn-sphere/filter": patch
"@fn-sphere/filter": minor
---

`updateInput` in `DataInputViewProps` now use spread parameter to accept new values.
- BREAKING CHANGES

```diff
- updateInput([newValue]);
+ updateInput(newValue);
```
- `updateInput` in `DataInputViewProps` now use spread parameter to accept new values.

```diff
- updateInput([newValue]);
+ updateInput(newValue);
```
3 changes: 2 additions & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "docs",
"private": true,
"version": "0.0.0",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand Down

0 comments on commit 84638d3

Please sign in to comment.