Last active
November 8, 2019 05:56
-
-
Save Sawtaytoes/a81d298287f8f54e54f41a935afcc277 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function instance($$self, $$props, $$invalidate) { | |
let count = 0 | |
const stateModifiers = { | |
DECREMENT: () => { | |
$$invalidate('count', count -= 1) | |
}, | |
INCREMENT: () => { | |
$$invalidate('count', count += 1) | |
}, | |
} | |
const store = ( | |
createStore( | |
stateModifiers | |
) | |
) | |
function click_handler() { | |
store.dispatch({ type: 'DECREMENT' }) | |
} | |
function click_handler_1() { | |
store.dispatch({ type: 'INCREMENT' }) | |
} | |
return { | |
count, | |
store, | |
click_handler, | |
click_handler_1 | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment