Coder Social home page Coder Social logo

redux-tiny-router's People

Contributors

agamennon avatar cuthbertjungle avatar gausie avatar quazzie avatar srph 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  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  avatar  avatar  avatar  avatar

redux-tiny-router's Issues

React 0.14

package.json lists react ^0.13.3 as a dependency. It seems more appropriate to be a peer dependency, in any case.

URL Params support?

For example I like the way flask does it and forces a type:

/project/edit/<int:project_id>/

Additionally I'd say then you need a way to generate a URL as well...

I'd love it if there was a global way to add the trailing slash or not as well.

But this currently looks very clean and reduxy ;-) React Router is very overbearing and I'm not sure they have got everything right with their recent 1.0 API changes. Well played.

Cannot read property 'preventNavigation' of undefined

Hey

Looks like when I'm combining reducers the initial state isn't set somehow.

I can see the state as

Object {counter: Object}

so router is missing.

My reducer function looks like this:

import { combineReducers } from 'redux';
import counter from './counter';
import { tinyReducer } from 'redux-tiny-router';

const rootReducer = combineReducers({
  tinyReducer,
  counter,
});

export default rootReducer;

Am I missing something?

Getting error when using OPTION2 initialization

When using the OPTION2 initialization, described in the README.md, getting this JavaScript error:

Uncaught ReferenceError: __UNIVERSAL__ is not defined

Setting window.__UNIVERSAL__ = false; before initialization fixes the issue.

The error is happening in reduxTinyRouter.js at window.__UNIVERSAL__ = __UNIVERSAL__ || false;

Redirecting after submitting a form

Hey,

your library sounds interesting!

I have one question though which apparently is quite unclear how to solve it with redux + router.

So let's say I'm on a page where I have a form. I fill up the form and I submit it. After the submit, if successful, I want to redirect to another page otherwise show an error message on the form page itself.
This is a quite common use case but I haven't figure it out how to properly redirect.

The flow looks like this:

  • render component page with form
  • fill up form
  • submit form
  • execute action
  • make api request
  • dispatch action
  • update reducer state
  • app re-renders

Before the last step I should know if I need to redirect or re-render and show an error message. But how would you do it? The reducer simply returns the state and the component needs to check for something to make a decision (e.g.: redirect or not). I could set into the state something like shouldRedirect: true so the component knows it has to redirect but this is not nice.

Ideally I want to say: given that action I want to transition to somewhere.

What are your thoughts? Thanks!

set and setRoutes from within component

It would be great to be able to use setRoutes from within the component (constructor probably). I could then do this:

_getRoutes() {
  return {
    '/': <SomeComponent />,
    '/users/*': <SomeOtherComponent>,
  }
}

constructor() {
  super();
  utils.setRoutes(Object.keys(this._getRoutes()));
}

And then later something like const component = this._getRoutes(this.props.router.src) to choose the component.

However, it seems i can only do it externally to the class. Is this fixable?

Remove rtr- prefix

I find it weird. Is there a good reason we have this?

By the way, thanks for your good work! ๐Ÿ˜„

TypeError: setting a property that has only a getter

There is an error that prevents rendering using Firefox 42 on Windows 7:

TypeError: setting a property that has only a getter

The error occurs on line 28 of enhancer/enhancer.js:

Object.assign(reducer,tinyReducer,reducer);

I can fix the error by changing that line to:

Object.assign(reducer,tinyReducer);

Vitality of the project ?

Hello @Agamennon

first I'd like to thank you for this library, love the philosophy. I was going to write something similar myself when I stubbled uppon your code :)
That said, as I am starting a new project in my company, I am a little worried to see that pull request from months ago are still to be merged.
So I guess my question is, are you still maintaining this project ?
I'll be glad to help if needed.

State from url hash

Hey! Soooooo in to this as a routing solution. Thank you for making it :D.

I'm going to dig through the source a little, but wanted to see if you had plans/thoughts on reading the state from a hash fragment as an optional alternative to reading the standard path.

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.