"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.unsafeDone = void 0;
const state_1 = require("./state");
/**
 * Unsafe version of done
 */
function unsafeDone(io) {
    return (promise) => {
        const state = promise.state.get;
        if (state._tag === "Pending") {
            promise.state.set(new state_1.Done(io));
            Array.from(state.joiners)
                .reverse()
                .forEach((f) => {
                f(io);
            });
        }
    };
}
exports.unsafeDone = unsafeDone;
//# sourceMappingURL=unsafeDone.js.map