export function chain<State>(...args: any[]) {
  if (
    args[0] instanceof Array ||
    args[0] instanceof Set ||
    args[0] === undefined