Coder Social home page Coder Social logo

react-circuit's People

Watchers

 avatar  avatar

react-circuit's Issues

add context to Result

Circuit and Result should have same context
setResult should pass (props, context) as last 2 args to handler

renderApp, wrapState first last args

  • process handler doesn't need to be called with context
  • allow process to invoke handler with first, last args with state, props sandwiched in between
  • this will enable consistency in args passed to process handler, publisher and result handler -- (msg, appState, appProps, props, context) -- last 2 are only for Process not Result
  • Result continues to bind handler functions to this

refactor Process component ctor

  • after initializing refs, pass to beginPolling directly instead of storing on instance
  • do inialization in willMount to reach instance properties
class C {
increment = handler
//methods will work too: increment(...args) { return handler(...args) }
}

derive error handlers

use naming convention to derive error handlers with process handlers - add suffix: "Errors" to handler name

refactor Presenter component

  • after initializing refs, pass to subscriber directly instead of storing on instance
  • wrap handlers before calling subsciber
  • remove constructor

naming

  • rename mapper to selector
  • use Error suffix to match handlers
  • use $ suffix to match selector
  • rename Result to Presenter
  • don't merge actions in createTransport - use inActions, outActions

createTransport make actions property of intake, outtake

intake: { ...channels, actions: { ...createActions } }
outtake: { ...channels, actions: { ...createActions }, subscribe: { ...createSubscriptions} }

do not override existing actions, subscribe

also export createActions, createSubscriptions

create Pipe component

a mix of Result and Processs, in that -
like Process subscribes to intake channel, but calls registered handler w/o wrapping it in renderApp
like Result in that it does not have a publisher

unlike Result or Process, in that - does not care about component state or app state

appProps are not needed in handlers

just pass appState in wrapState, no need for root/app props

  • Process handler and selectors will get (msg, appState, props, context)
  • setResult should set component props in the lastArgs

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.