1.1.12 • Published 7 years ago

rrrouter v1.1.12

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

#What?! Another router for React?! Let's start with React - from official documentation:

What is React?

React is a declarative, efficient, and flexible JavaScript library for building user interfaces.

Composition

The key feature of React is composition of components. Components written by different people should work well together. It is important to us that you can add functionality to a component without causing rippling changes throughout the codebase.

Common Abstraction

We don't want to bloat your apps with useless library code.

Stability

We value API stability.

#So why? It's true that there are already dozen routers for React. It's sad, but there is no any implementation that respects React way: non-bloated, easy to extend, simple yet powerful, stable api.

To learn rrrouter you must know only 3 things:

  • Provider
  • Router
  • Route

But let's start from beginning...

#Architecture Architecture

As you can see:

  • There can be only one Provider with many Routers
  • Each Router can have multiply Routes

But let's describe purpose of each component.

ComponentDescription
ProviderProvides current route information and actions to mutate it. Will notify each Router about changes of current route. Only Routers work directly with Provider.
RouterGroups Routes, provides methods for matching/testing hrefs, exposes current route and actions from Provider. Will notify each Route(if condition met) about changes. Any component that wants to get information about current route or mutate it, must use Router for it.
RouteRenders a component or invokes a callback if condition met.

#TODO:

  • documentation
  • examples
  • tests
1.1.12

7 years ago

1.1.11

7 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.4-a

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago