Skip to content

v2

Choose a tag to compare

@UpperCod UpperCod released this 14 Aug 16:49
· 29 commits to master since this release

@atomico/router@2 eliminates the transitions by css, to now be delegated by load with the use of asynchronous generators, example:

 <RouterSwitch>
      <RouterCase
        path="/{folder}"
        memo
        load={async function* (params) {
          yield <h1>Loading...</h1>;

          await delay(1000);

          return (
            <h1>
              welcome! ({JSON.stringify(params)}) <a href="/">to home</a>
            </h1>
          );
        }}
      ></RouterCase>
</RouterSwitch>

The objective of simplifying the core is to give space to functionalities that are more related to the logic and optimization of routes for SPA applications.