No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
bad-factory.js
counter-factory.js
counter.js
test-bad-factory.js
test-factory.js
test-one.js
test-two-factories.js
test-two.js

README.md

counter-factory-demo

Demos issues to consider when creating a NodeJS factory.

Usage

For usage details see the article NodeJS Module Factories:

Files:

  • counter.js - a demo counter module
  • test-one.js - demo using just one instance of the counter module
  • test-two.js - demo what can go wrong when two instances of the counter are declared
  • bad-factory.js - demo of a factory module strategy that will fail
  • test-bad-factory.js - demo the issues with the bad factory module
  • counter-factory.js - demo of a factory module that should work as expected
  • test-factory.js - demo the factory module in usage
  • test-two-factories.js - demo how factory still works for multiple instances

Repo(s)