Export a factory function to create a separate list each time it's called.
Return the reactive object. Components can read and update its properties just like local state.
export function createTodos() {
const list = $state({
todos: [{ task: 'Walk dog', completed: false }],
});
return list;
}