UNPKG

@modern-js/plugin

Version:

A Progressive React Framework for modern web development.

14 lines (13 loc) 297 B
const createCounter = (callback) => { const dispatch = (index, input) => { const next = (nextInput = input) => dispatch(index + 1, nextInput); return callback(index, input, next); }; return { start: (input) => dispatch(0, input), dispatch }; }; export { createCounter };