https://github.com/utyfua/univer-sheet-data-sync
Easier way to sync data between Univer Sheets and custom data sources
https://github.com/utyfua/univer-sheet-data-sync
sheet spreadsheet univer
Last synced: about 1 year ago
JSON representation
Easier way to sync data between Univer Sheets and custom data sources
- Host: GitHub
- URL: https://github.com/utyfua/univer-sheet-data-sync
- Owner: utyfua
- Created: 2025-06-03T19:10:53.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-03T19:32:22.000Z (about 1 year ago)
- Last Synced: 2025-06-04T04:24:57.535Z (about 1 year ago)
- Topics: sheet, spreadsheet, univer
- Language: TypeScript
- Homepage: https://utyfua.github.io/univer-sheet-data-sync/
- Size: 62.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# univer-sheet-data-sync
Easier way to sync data between Univer Sheets and custom data sources.
To use please review the [playground example](https://github.com/utyfua/univer-sheet-data-sync/blob/master/playground/main.ts).
Live preview is available [here](https://utyfua.github.io/univer-sheet-data-sync/).
## Notes
- You need to add at least one sheet via the `upsertSheet` method before calling `.bootstrap()`;
otherwise, Univer will create an empty sheet.
- You can override any part of the data model via the `setSheetDataModel` method, including data and listeners.
- When replacing a listener, the library will gradually dispose of the old one and start using the new one.
- You can skip setting `data` unless you actually have data to show.
- For example, you can use `setSheetDataModel` to fetch data from the server and then set it to the sheet.
## Keep data model in sync
### `rejectInvalidInput` is true
When `rejectInvalidInput` is true, the library will use `validateCellValue` to check if the value is valid before
calling `onCellValueChange`.
### `accumulateChanges` is false
When `accumulateChanges` is false or not set, the library will expect you are modifying
or persisting the data object yourself when handling `onCellValueChange`.
If you are not doing this, the library will keep new state until you set same data again via `setDataModel`.
### `accumulateChanges` is true
When `accumulateChanges` is true, the library will accumulate changes as set of mutations.
`validateCellValue` and `onCellValueChange` will be called for each change but you SHOULD NOT change the data.
## License
`univer-sheet-data-sync` is released under the MIT License.
---
`univer-sheet-data-sync` is not affiliated with Univer or DreamNum Co., Ltd.