Git Product home page Git Product logo

reflex's People

Contributors

howmanysmall avatar littensy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

howmanysmall hy2k

reflex's Issues

Pass combined producer to Broadcaster

Currently, the broadcaster state-getter calls getState on every producer in the map. This is prone to bugs since the combined producer does not update the state of the individual producers!

Pass the root producer to Broadcaster, and filter out non-shared state when a player retrieves state.

Write tests to make sure this bug doesn't come back.

Consider async actions

It's possible to allow an action to return a Promise to defer a state update. Actions run independently from one another, and they get called directly, so it should be safe to allow it

But why do some state management libraries allow async actions while others don't?

Combine subscribe and observe

Combine subscribe and observe into a single function with overloads for both cases.

producer.subscribe(callback)
producer.subscribe(selector, callback)

Add `predicate` argument to `subscribe`

This should be straightforward to implement and simplifies some functions.

We might be able to define multiple overloads with:

local arguments = select("#", ...)
local selector, predicate, listener

if arguments == 1 then
  listener = ...
elseif arguments == 2 then
  selector, listener = ...
else
  selector, predicate, listener = ...
end

Optimize combineProducers

I ran a benchmark, and combineProducers is over 100% slower than manually combining state in a single producer. Optimizations can be made to reduce overhead from wrapping producers.

Publish to Wally

Release this package for Luau on Wally.

Imports can be resolved with a function that checks Reflex's parent for a package of the same name and a possible src or out entry point.

Promise will need to be re-exported and attempt to import any installed Promise module as a dependency first.

Throw more descriptive errors

Reflex should throw more descriptive errors for oversights like:

  • Mutating state, enforced by deep-freezing
  • Type errors in parameters or return values
  • Selectors returning a different value for the same state input
  • observe receiving a record of objects with no discriminator
  • Invalid middleware functions
  • Broadcasters sending invalid data types (i.e. non-string keys)

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.