Code Monkey home page Code Monkey logo

ngxs-examples's Introduction


NGXS is a state management pattern + library for Angular



Quick Links


The Goal of NGXS

NGXS tries to make things as simple and accessible as possible. There can be a lot of boilerplate code in state management, thus a main goal of NGXS is to reduce boilerplate allowing you to do more things with less. It is also not necessary to be super familiar with RxJs.

The Goal of NGXS Labs

The idea with this github organisation is to provide a place for the community to create libraries that augment the main framework with functionality that does not need to be integrated directly into the framework and therefore can evolve through their initial iterations of experimentation without affecting the main @ngxs/store library.

Getting Started - Local Development

Installation

To get started locally, follow these instructions:

  1. If you haven't done it already, make a fork of this repo.
  2. Clone to your local computer using git.
  3. Make sure that you have installed NodeJS.
  4. Make sure that you have yarn installed.
  5. Run yarn install.
  6. Run yarn build:packages.

Creating new packages or add feature/fix

if you make changes @ngxs/store
  1. Run development mode yarn build:packages --package store --watch
  2. Run serve integration examples yarn start
  3. ...development...
  4. Run tests yarn test:ci
  5. Create pull request
if you add a new package @ngxs/my-super-plugin
  1. Create a new project folder packages/my-super-plugin
  2. Create template library with ngPackagr
  3. Add your project to package.json
  4. Run development mode yarn build:packages --package my-super-plugin --watch
  5. ...development...
  6. Run build yarn build:packages --package my-super-plugin
  7. Run tests yarn test:ci
  8. Create pull request

NGXS Labs

If you have ideas for creating unique libraries, you can join us. Email us at [email protected]. Or you can email us on Twitter or Slack.

Packages

Tools

Project Package Version Links
NGXS CLI @ngxs/cli latest README
NGXS Schematics @ngxs/schematics latest README

Packages

Project Package Version Links
NGXS Store @ngxs/store latest README snapshot
NGXS Logger-plugin @ngxs/logger-plugin latest README snapshot
NGXS Devtools-plugin @ngxs/devtools-plugin latest README snapshot
NGXS WebSocket-plugin @ngxs/websocket-plugin latest README snapshot
NGXS Form-plugin @ngxs/form-plugin latest README snapshot
NGXS Router-plugin @ngxs/router-plugin latest README snapshot
NGXS Storage-plugin @ngxs/storage-plugin latest README snapshot
NGXS HMR @ngxs/hmr-plugin latest README snapshot

NGXS Labs

Project Package Version Links
NGXS-labs Data @ngxs-labs/data latest README
NGXS-labs Emitter @ngxs-labs/emitter latest README
NGXS-labs Immer adapter @ngxs-labs/immer-adapter latest README
NGXS-labs Dispatch decorator @ngxs-labs/dispatch-decorator latest README
NGXS-labs Select snapshot decorator @ngxs-labs/select-snapshot latest README
NGXS-labs Async storage plugin @ngxs-labs/async-storage-plugin latest README
NGXS-labs Entity state @ngxs-labs/entity-state latest README
NGXS-labs Testing tools @ngxs-labs/testing latest README
NGXS-labs Actions Executing @ngxs-labs/actions-executing latest README
NGXS-labs Attach Action @ngxs-labs/attach-action latest README

Community

Project Package Version Links
Reset Plugin ngxs-reset-plugin latest README
NGXS-Loading-plugin ngxs-loading-plugin latest README
NGXS-History-plugin ngxs-history-plugin latest README

Contributors

Thanks to all our contributors!

ngxs-examples's People

Contributors

bwca avatar cristian-malinescu avatar leon avatar splincode avatar urdenko 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

Watchers

 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

ngxs-examples's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Ngxs - Autologout

Hi

This is not an issue just a request for assistance
I was wondering if you can point me at any samples that show you how to perform an auto logout after 5 minutes of inactivity?

Thanks
Damien

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

The navigateByUrl called in @Action handler does not change the view

  1. go to http://localhost:4200/auth/login
  2. click on Login with Google
  3. FAIL: you are still on the login page

At that point the URL already shows /dashboard route and it also with enabled tracing, you can see the navigation has ended successfully.

However the still appears in the DOM.

screen shot 2018-04-07 at 11 15 52 am
screen shot 2018-04-07 at 11 16 04 am

onLoginSuccess, navigating to /dashboard
platform-browser.js:380 Router Event: NavigationStart
platform-browser.js:367 NavigationStart(id: 1, url: '/dashboard')
platform-browser.js:367 NavigationStart {id: 1, url: "/dashboard"}
auth.state.ts:129 setUserStateOnSuccess
platform-browser.js:380 Router Event: RouteConfigLoadStart
platform-browser.js:367 RouteConfigLoadStart(path: dashboard)
platform-browser.js:367 RouteConfigLoadStart {route: {…}}
platform-browser.js:380 Router Event: RouteConfigLoadEnd
platform-browser.js:367 RouteConfigLoadEnd(path: dashboard)
platform-browser.js:367 RouteConfigLoadEnd {route: {…}}
platform-browser.js:380 Router Event: RoutesRecognized
platform-browser.js:367 RoutesRecognized(id: 1, url: '/dashboard', urlAfterRedirects: '/dashboard', state: Route(url:'', path:'') { Route(url:'dashboard', path:'dashboard') { Route(url:'', path:'') }  } )
platform-browser.js:367 RoutesRecognized {id: 1, url: "/dashboard", urlAfterRedirects: "/dashboard", state: RouterStateSnapshot}
platform-browser.js:380 Router Event: GuardsCheckStart
platform-browser.js:367 GuardsCheckStart(id: 1, url: '/dashboard', urlAfterRedirects: '/dashboard', state: Route(url:'', path:'') { Route(url:'dashboard', path:'dashboard') { Route(url:'', path:'') }  } )
platform-browser.js:367 GuardsCheckStart {id: 1, url: "/dashboard", urlAfterRedirects: UrlTree, state: RouterStateSnapshot}
platform-browser.js:380 Router Event: ChildActivationStart
platform-browser.js:367 ChildActivationStart(path: '')
platform-browser.js:367 ChildActivationStart {snapshot: ActivatedRouteSnapshot}
platform-browser.js:380 Router Event: ActivationStart
platform-browser.js:367 ActivationStart(path: 'dashboard')
platform-browser.js:367 ActivationStart {snapshot: ActivatedRouteSnapshot}
platform-browser.js:380 Router Event: ChildActivationStart
platform-browser.js:367 ChildActivationStart(path: 'dashboard')
platform-browser.js:367 ChildActivationStart {snapshot: ActivatedRouteSnapshot}
platform-browser.js:380 Router Event: ActivationStart
platform-browser.js:367 ActivationStart(path: '')
platform-browser.js:367 ActivationStart {snapshot: ActivatedRouteSnapshot}
platform-browser.js:380 Router Event: GuardsCheckEnd
platform-browser.js:367 GuardsCheckEnd(id: 1, url: '/dashboard', urlAfterRedirects: '/dashboard', state: Route(url:'', path:'') { Route(url:'dashboard', path:'dashboard') { Route(url:'', path:'') }  } , shouldActivate: true)
platform-browser.js:367 GuardsCheckEnd {id: 1, url: "/dashboard", urlAfterRedirects: UrlTree, state: RouterStateSnapshot, shouldActivate: true}
platform-browser.js:380 Router Event: ResolveStart
platform-browser.js:367 ResolveStart(id: 1, url: '/dashboard', urlAfterRedirects: '/dashboard', state: Route(url:'', path:'') { Route(url:'dashboard', path:'dashboard') { Route(url:'', path:'') }  } )
platform-browser.js:367 ResolveStart {id: 1, url: "/dashboard", urlAfterRedirects: UrlTree, state: RouterStateSnapshot}
platform-browser.js:380 Router Event: ResolveEnd
platform-browser.js:367 ResolveEnd(id: 1, url: '/dashboard', urlAfterRedirects: '/dashboard', state: Route(url:'', path:'') { Route(url:'dashboard', path:'dashboard') { Route(url:'', path:'') }  } )
platform-browser.js:367 ResolveEnd {id: 1, url: "/dashboard", urlAfterRedirects: UrlTree, state: RouterStateSnapshot}
platform-browser.js:380 Router Event: ActivationEnd
platform-browser.js:367 ActivationEnd(path: '')
platform-browser.js:367 ActivationEnd {snapshot: ActivatedRouteSnapshot}
platform-browser.js:380 Router Event: ChildActivationEnd
platform-browser.js:367 ChildActivationEnd(path: 'dashboard')
platform-browser.js:367 ChildActivationEnd {snapshot: ActivatedRouteSnapshot}
platform-browser.js:380 Router Event: ActivationEnd
platform-browser.js:367 ActivationEnd(path: 'dashboard')
platform-browser.js:367 ActivationEnd {snapshot: ActivatedRouteSnapshot}
platform-browser.js:380 Router Event: ChildActivationEnd
platform-browser.js:367 ChildActivationEnd(path: '')
platform-browser.js:367 ChildActivationEnd {snapshot: ActivatedRouteSnapshot}
platform-browser.js:380 Router Event: NavigationEnd
platform-browser.js:367 NavigationEnd(id: 1, url: '/dashboard', urlAfterRedirects: '/dashboard')
platform-browser.js:367 NavigationEnd {id: 1, url: "/dashboard", urlAfterRedirects: "/dashboard"}

Naming convention inconsistencies

Hi, I'm looking to use NGXS for the first time and wanted to make sure I started off my naming convention on the right foot.

In some examples, the class that houses the @selectors and @actions are suffixed with "Store" and the state models are suffixed with "State".

In other examples, those types of classes are suffixed with "State" and the state models are suffixed with "Model".

I looked at the style guide and didn't see anything specific other than the naming of the files themselves. Can someone point me in the right direction on this?

status of project 2, 3 and 4?

Are project 2, 3 and 4 not pushed? readme gives the impression that they are complete but I couldn't find them in the repo.

unit tests

This lib is really great, but I'm trying to make an effort to unit test all of my code and I was hoping to find examples of unit tests. Specifically the DI piece and mocking the NGXS pieces.

When my component constructor takes in the store as a constructor and I import NgxsModule.forRoot([MyState]) in the TestBed my tests still fail w/ "Can't resolve all parameters for ".

This would be a great repo to show how to unit test an app that uses NGXS including mocking.

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.