Coder Social home page Coder Social logo

ember-states's Introduction

ember-states Build Status

ember-states is Ember's implementation of a finite state machine. A StateManager instance manages a number of properties that are instances of State, tracks the current active state, and triggers callbacks when states have changed.

For more info check documentation of StateManager in addon/state-manager.js

Including In An Ember Application

Here is the simplest way to get started with ember-states:

ember install ember-states

How to Run Unit Tests

npm install
ember test

ember-states's People

Contributors

danielochoa avatar ebryn avatar fivetanley avatar ibroadfo avatar krisselden avatar lukemelia avatar rwjblue avatar stefanpenner avatar trek avatar wagenet 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

Watchers

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

ember-states's Issues

Factory name for injecting into StateManagers in an initializer?

Hi,

I'm trying to use application.inject() in an initializer in order to make an object available to my StateManager and I was wondering what the correct name for the factory of StateManagers is in order to do this?

For example, here I register my PassManager object and inject it into my application's controllers:

application.register('service:pass_manager', PassManager);
application.inject('controller', 'passManager', 'service:pass_manager');

This works correctly. But now I want to also inject this same PassManager object into the StateManager subclasses I'm using in my application. I tried:

application.inject('stateManager', 'passManager', 'service:passManager');

without any luck. Is it possible to inject into StateManager in this way?

(Note: It happens that the object I'm trying to inject is also a StateManager subclass, but that doesn't seem to me like it would be a problem other than needing to scope this inject statement to not be circular, for example by changing the first argument to: 'stateManager:MyOtherSMSubclass' rather than simply 'stateManager' or whatever the correct factory name is.)

add to bower

can you add this to bower so I can install it via commandline?

[enhancement] Add missing bower.json.

Hey, maintainer(s) of emberjs/ember-states!

We at VersionEye are working hard to keep up the quality of the bower's registry.

We just finished our initial analysis of the quality of the Bower.io registry:

7530 - registered packages, 224 of them doesnt exists anymore;

We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).

Sadly, your library emberjs/ember-states is one of them.

Can you spare 15 minutes to help us to make Bower better?

Just add a new file bower.json and change attributes.

{
  "name": "emberjs/ember-states",
  "version": "1.0.0",
  "main": "path/to/main.css",
  "description": "please add it",
  "license": "Eclipse",
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {
    "<dependency_name>": "<semantic_version>",
    "<dependency_name>": "<Local_folder>",
    "<dependency_name>": "<package>"
  },
  "devDependencies": {
    "<test-framework-name>": "<version>"
  }
}

Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.

NB! Please validate your bower.json with jsonlint before commiting your updates.

Thank you!

Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!

Is there any way to use ember-states with ember-cli?

ember-states doesn't export a module so it can't be imported in the usual way. It can be imported via script tag after the transpiled application js, but that means that StateManager sub-classes can't be used in app.js.

Is there a solution to this problem?

Install command line issue

Hey there!
When I execute the install commande line ember install ember-states, I get the following error:

No compatible version found: ember-states@'*'
Valid install targets:
["1.13.0-beta"]

I've managed to install it anyway with this line: ember install [email protected]
But then I can't import it into an ember-cli app.
When I try to use the following import statement

`import State from 'ember-states'`

I get this error in the browser javascript console:

Could not find module `ember-states/index` imported from `ember-states`

And I can't import it with an app.import since it's located in the node_modules folder.
Is there anything I do wrong?

Document what is ember-states

After reading README I know how to be up and running in less than a minute, build and test, but I don't know what is ember-states (apart from the fact that it's mentioned in ember.js code, and that my newly created app complains that Ember.State was moved here) :-)

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.