Skip to content

Instantly share code, notes, and snippets.

@luistak
Last active January 27, 2021 15:56
Show Gist options
  • Save luistak/6ace4f1a50c7a23cea24b9b67ac22a99 to your computer and use it in GitHub Desktop.
Save luistak/6ace4f1a50c7a23cea24b9b67ac22a99 to your computer and use it in GitHub Desktop.
import { Observable } from 'windowed-observable';
const observable = new Observable('messages');
function App() {
const handleSubmit = (e) => {
e.preventDefault();
const { target: form } = e;
const input = form?.elements?.something;
observable.publish(input.value);
form.reset();
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment