        const worker = new Worker('worker.js', { type: 'module' });

        // Message handler
        worker.onmessage = function(event) {
            const { cmd, ...data } = event.data;

            switch (cmd) {
                case 'show_posts':
                    elements.showResult.innerHTML = `<pre>${JSON.stringify(data.posts, null, 2)}</pre>`;
                    break;
                case 'create_post':
                    elements.createResult.innerHTML = `<pre>${JSON.stringify(data.post, nul