https://github.com/mark-when/view-client
Utility for a markwhen view to communicate with hosting app
https://github.com/mark-when/view-client
Last synced: 9 months ago
JSON representation
Utility for a markwhen view to communicate with hosting app
- Host: GitHub
- URL: https://github.com/mark-when/view-client
- Owner: mark-when
- Created: 2023-02-05T17:46:06.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-16T19:09:33.000Z (over 1 year ago)
- Last Synced: 2024-11-16T20:18:30.864Z (over 1 year ago)
- Language: TypeScript
- Size: 197 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Markwhen view client
## Usage
```js
import { useLpc } from "@markwhen/view-client"
const { postRequest } = useLpc({
markwhenState(ms) {
// When there is some state change from the editor
console.log(ms)
}
appState(newState) {
// When the app state changes (dark mode, hovering event, selected event, etc)
console.log(newState)
}
})
```
## Changelog
## 1.4.4
- Bump deps
## 1.4.3
- Bump parser
- Add close function to close sockets and/or remove event listeners
## 1.4.2
- VS code support
## 1.4.1
- Error if nothing to post to
### 1.4.0
- Separate state into appState and markwhenState instead of sending both at the same time
### 1.3.0
- Bump parser (0.9.1)
- Support for imports
### 1.2.1
- Bump parser (0.8.1)
- Add colorMap to appState
### 1.1.1
- Use initially set state even if we have a socket connection
### 1.1.0
- Add websocket support