UNPKG

@captaincodeman/rdx

Version:

Small state library. Like Redux, but smaller

2 lines (1 loc) 256 B
import{dispatchEvent as t}from"./const.js";function n(n){const e=n.dispatch.bind(n);return n.addEventListener(t,t=>{const{action:o}=t.detail;if("function"==typeof o){o(e,()=>n.state),t.stopImmediatePropagation(),t.preventDefault()}}),n}export{n as thunk};