Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

laxar-patterns

LaxarJS126MIT2.1.0

Utilities to implement standard event patterns in LaxarJS widgets

readme

LaxarJS Patterns Build Status

Utilities to implement standard event patterns in LaxarJS widgets

LaxarJS defines the semantics of core event patterns. For application-level events, LaxarJS Patterns provides an additional vocabulary, grouped into a handful of pattern families. Also, a helper library is provided, to simplify dealing with event subscriptions.

Have a look at the docs for more information, but make sure that you are familiar with LaxarJS first.

Installation

Install laxar-patterns into your LaxarJS project using npm:

npm install --save-dev laxar-patterns

For efficient usage of the available pattern libraries in your widgets, you should consult the API docs as well.

Building from Source

Instead of using a pre-compiled library within a project, you can also clone this repository:

git clone https://github.com/LaxarJS/laxar-patterns.git
cd laxar-patterns
npm install

To see changes in your application, either configure your project to work with the sources (e.g. by using webpack), or rebuild the webpack bundles by running npm run dist.

To run the automated karma tests:

npm test

To generate HTML spec runners for opening in your web browser, so that you can e.g. use the browser's developer tools:

npm start

Now you can select a spec-runner by browsing to http://localhost:8080/dist/lib/spec/laxar-patterns.spec.html

changelog

Changelog

Last Changes

v2.1.0

v2.1.0-rc.1

  • #100: updated dependencies

v2.1.0-rc.0

  • #99: errors: allow to pass custom message formatter
    • NEW FEATURE: see ticket for details
  • #86: resources: implemented support for replaceRequest events
    • NEW FEATURE: see ticket for details

v2.0.0

  • #96: documentation: improved Markdown syntax
  • #94: resources: better error messages for missing feature-config
  • #95: documentation: fixed API doc typo

v2.0.0-rc.2

  • #97: fixed dependencies in package.json

v2.0.0-rc.1

  • #93: documentation: fixed markdown list indent and a link to API

v2.0.0-rc.0

  • #91: infrastructure cleanup
  • #90: use laxar-widget-service-mocks instead of LaxarJS internals

v2.0.0-beta.1

  • #87: removed now obsolete bower.json
  • #89: actions: added optional option to publisherForFeature
    • NEW FEATURE: see ticket for details
  • #88: flags: empty publisher now returns a resolved promise

v2.0.0-beta.0

  • #79: upgraded manuals
  • #84: patches: removed deprecated API
    • BREAKING CHANGE: see ticket for details
  • #85: removed resources.replaceHandler and resources.updateHandler
    • BREAKING CHANGE: see ticket for details
  • #78: fixed method parameters and overhauled api doc
    • BREAKING CHANGE: see ticket for details
  • #81: flags: implemented flag publisher APIs
    • NEW FEATURE: see ticket for details
  • #75: actions: added documentation for timeout option
  • #82: validation: removed explicit log argument for handlerFor
    • BREAKING CHANGE: see ticket for details
  • #55: validation: fixed error event messages
    • BREAKING CHANGE: see ticket for details
  • #80: removed resources.isSame function
    • BREAKING CHANGE: see ticket for details
  • #54: event handlers: fixed promise semantics where necessary
    • BREAKING CHANGE: see ticket for details

v2.0.0-alpha.2

  • #77: project: added missing .npmignore

v2.0.0-alpha.1

  • #76: project: updated dev-dependencies, upgraded to webpack 2
  • #66: actions: added convenience method connectPublisherToFeature
    • NEW FEATURE: see ticket for details
  • #67: flags, resources: allow to pass just callbacks to handlers (instead of options object)
    • NEW FEATURE: see ticket for details
  • #74: adapted to changes in laxar
  • #72: adapted to removed event bus unsubscribe method
  • #73: resources: using log from context object
  • #71: eslint: use shared configuration
  • #70: additional eslint restrictions
  • #69: karma/webpack: added firefox/chrome setup
  • #68: switched to webpack build
    • BREAKING CHANGE: see ticket for details

v2.0.0-alpha.0

  • #65: adopted to changes due to removing angular in LaxarJS
  • #64: using locally installed jspm
  • #63: testing: updated spec runners to Jasmine 2.4
  • #62: transformed AMD modules to es2015 modules
    • BREAKING CHANGE: see ticket for details
  • #61: project: updated copyright year in file header
  • #59: dependencies: added missing dependencies to package.json

v1.2.0-alpha.2

  • #58: actions, resources, validation: do not cache q

v1.2.0-alpha.1

  • #57: resources, validation: get q from laxar-tooling (do not create AngularJS injector)
    • NEW FEATURE: see ticket for details

v1.2.0-alpha.0

  • #56: actions: get q from laxar-tooling (do not create AngularJS injector)
    • NEW FEATURE: see ticket for details

v1.1.0

  • #46: validation: implemented validation handler
    • NEW FEATURE: see ticket for details

v1.1.0-alpha.2

  • #53: resources: pass meta to event callbacks
  • #50: patches: added deprecation notice

v1.1.0-alpha.1

  • #52: resources: fixed whenAllWereReplaced with multiple handlers for the same topic

v1.1.0-alpha.0

  • #51: resources: allow to mark resource configuration as optional
    • NEW FEATURE: see ticket for details
  • #49: documentation: clarify argument order for json.createPatch
  • #48: tests: allow to execute spec-tests using a project RequireJS configuration
    • NEW FEATURE: see ticket for details
  • #47: added Travis-CI build integration
    • NEW FEATURE: see ticket for details
  • #45: api-doc: update generated api doc

v1.0.0

  • #44: documentation: fixed some minor issues

v1.0.0-beta.0

  • #43: tests: fixed usage of laxar_testing for laxar-dist
  • #42: documentation: provided updated API doc for relevant modules

v1.0.0-alpha.3

  • #40: documentation: small fixes

v1.0.0-alpha.2

  • #39: project: renamed from laxar-patterns to laxar-patterns
    • BREAKING CHANGE: see ticket for details

v1.0.0-alpha.1

  • #37: json: updated fast-json-patch to latest official release.

v1.0.0-alpha.0

  • #36: actions. fixed minification bug due to missing strict DI.
  • #29: resources: set resources as fixed bucket name.
    • BREAKING CHANGE: see ticket for details
  • #34: actions. removed support for done callback in action handlers.
    • BREAKING CHANGE: see ticket for details
  • #33: actions: added support for event objects in action handlers
    • NEW FEATURE: see ticket for details
  • #25: footprint: removed underscore dependency
  • #27: resources: removed handling of didUpdate events with deprecated event payload.
    • BREAKING CHANGE: see ticket for details

v0.20.0

  • #35: cleanup: removed dist-task fragments from grunt- and package configuration
  • #31: documentation: fixed wrong payload attribute in flags.md
  • #32: resources: updatePublisher should ignore empty updates
    • NEW FEATURE: see ticket for details

v0.19.0

  • #30: resources: allow paths for isSame comparison
  • #28: visibility: use publishAndGatherReplies in request publishers

v0.18.0

  • #26: documentation: overview, resource/action/flag/error patterns
  • #24: refactoring: use laxar.string rather than laxar.text

v0.17.0

  • #23: actions: added promise support for asynchronous handlers.

v0.16.0

  • #22: actions: implemented action handler and publisher convenience.
    • NEW FEATURE: see ticket for details

v0.15.0

  • #21: resources: added deliverToSender option to event publishers.
  • #20: fixed wrongly global assert in jshintrc.

v0.14.0

  • #19: tests: make sure PhantomJS is installed properly, before running spec tests.
  • #18: added support for visibility events
    • NEW FEATURE: see ticket for details

v0.13.0

  • #17: replace and update publishers now return a promise.
  • #16: don't try to load widget.json in laxar-patterns specs.
  • #15: json: added helpers to work with json pointer (rfc-6901) and json patch (rfc-6902)
  • #14: temporarily switched to the LaxarJS fork of json patch.

v0.12.0

  • #12: added support for JSON patch in didUpdate events.
    • NEW FEATURE: see ticket for details
  • #13: Remove some obsolete NPM devDependencies.
  • #11: added missing require path mapping for jjv and jjve.

v0.11.0

  • #8: resources: added method wereAllReplaced to find out if all registered resources have been replaced
    • NEW FEATURE: see ticket for details
  • #10: errors: implemented publisher for the didEncounterError event
    • NEW FEATURE: see ticket for details
  • #7: resources: fixed null-pointer when handling isOptional
  • #6: i18n: fixed localize to not use fallback for non-i18n values.
  • #9: jshintrc: disabled enforcement of dot notation for object property access.
  • #5: Fixed jshint violation

v0.10.0

  • #4: Allowed to keep receiving updates from whenAllWereReplaced after initial replacement (set watch option to true).
  • #2: Gracefully handle optional resources, fixed resource spec tests.
  • #3: patches.create: exclude properties starting with $$.
  • #1: Update Bower from ~1.2.8 to ~1.3.3.