/todo-list-ce

innovative console TodoList application

Primary LanguageTypeScript

Version

innovative TodoList 📝 [CE]*

*Console Edition

setup ⚙️

cd todo-list-ce

yarn setup
# or
npm setup

build 🛠

yarn build

start 🚀

yarn start

developing 🧱

yarn dev:build
yarn dev:start
// add new commands [./src/innovativeToDoList/interactionController/interactionController.ts]

interface ICommand {
    name: string,
    make: () => void
}

const command: ICommand = {
    name: '/exit',
    make: () => process.exit(0)
}

commands.push(command)
// working with Flux (observable)

import { Stream } from "./observable/FLux";
import { ITodoItem } from "./innovativeToDoList/types/types";

const stream = new Stream<Array<ITodoItem>>([])

stream.addSubscriber({
    name: 'change',
    do(data) {
        console.log(data)
    }
})

const newTodo: ITodoItem = {
    text: 'new todo item',
    createdDate: new Date(),
    id: Date.now(),
    isDone: false
}

stream.setData(prev => [ ...prev, newTodo ])

preview: