Code Monkey home page Code Monkey logo

app-world's Introduction

trying things with streams

Let's make applications in javascript


what are we doing?

What are some things that we want?

We want to know what's going on in the application

We want to know when we write code that is bad

We want to be able to change the app quickly without breaking it


What if all our application code was static and synchronous?


Our application has many domain models -- state machines that reflect persisted state and are re-used in many views in the app. These are distinct from view state, which is ephemeral and specific to the UI.

We want tests that tell us if anything breaks. If someone changes an event that is emitted by a view, does that break the application? What about if someone changes a model's state and breaks the view, will our tests catch that?

some terminology

A stream contains application events or other streams.

Events are objects with a key and a value.

Effects are a map from events to streams. They get called with the current state of the store. If an effect does something synchronous it returns an event, if does something async it returns a stream.

A view is a duplex stream that renders to the DOM when it is written to, and emits events from dom interactions.


Our state is a tree. Nodes become less generic as they get closer to the root of the tree.

    a
  /   \
 b     c

Here a would be the view state specific to our app. b and c might be domain models -- state that is re-used across the app.

todo

  • typescript + pull-stream

app-world's People

Contributors

nichoth avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.