SHARE
TWEET

Untitled

a guest Dec 18th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const appEvents = pubSub();
  2. const appState = state("", appEvents);
  3.  
  4. const input = document.querySelector('.app input');
  5. const paragraph = document.querySelector('.app p');
  6.  
  7. input.addEventListener('input', (evt) => {
  8.   appState.setValue(evt.srcElement.value);
  9. });
  10.  
  11. appEvents.subscribe((newValue) => {
  12.   paragraph.textContent = newValue;
  13. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top