{"id":15994286,"url":"https://github.com/pixelhandler/ember-bucket","last_synced_at":"2025-03-18T01:30:55.288Z","repository":{"id":17153348,"uuid":"19920159","full_name":"pixelhandler/ember-bucket","owner":"pixelhandler","description":"Bucket object for batch processing, singleton to be used as a service for buckets; with components for controls","archived":false,"fork":false,"pushed_at":"2014-08-18T19:00:48.000Z","size":736,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-15T07:49:30.496Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pixelhandler.github.io/ember-bucket/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pixelhandler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-18T20:21:20.000Z","updated_at":"2019-08-13T15:41:55.000Z","dependencies_parsed_at":"2022-09-11T06:51:36.313Z","dependency_job_id":null,"html_url":"https://github.com/pixelhandler/ember-bucket","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fember-bucket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fember-bucket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fember-bucket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fember-bucket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixelhandler","download_url":"https://codeload.github.com/pixelhandler/ember-bucket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221704154,"owners_count":16866697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T07:08:06.754Z","updated_at":"2024-10-27T16:27:11.767Z","avatar_url":"https://github.com/pixelhandler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ember Bucket\n\nBucket object for batch processing, singleton to be used as a service for buckets; with components for controls\n\nSee the example app code for usage. [View Demo](http://pixelhandler.github.io/ember-bucket/)\n\n[![Build Status](https://travis-ci.org/pixelhandler/ember-bucket.svg)](https://travis-ci.org/pixelhandler/ember-bucket)\n\n## Install\n\n    bower install ember-bucket\n    \nOr, just download what you need from the dist directory.\n\n## Overview\n\nThe bucket object is intended to be used as a service object and injected as a dependency where needed, e.g. controllers.\n\nThe `eb-control` and `eb-label` components are simple elements for interaction with the a bucket. the `eb-bucket` component is a layout of labels and controls.\n\nA `bucket` is a collection of objects to be processed (batch).\n\nThe `bucket service` is a singleton and generates buckets for batch processing of objects.\n\nA `BucketProcessableMixin` is used with objects that will be processed in a bucket. For example an object with a `save` method can use this property `bucketMap: { 'save': { 'isDirty': [ true ] }}` to insert itself into a 'save' bucket when it's `isDirty` property becomes `true`. Alternatively it will remove itself from the 'save' bucket when `isDirty` is not `true`.\n\nEach object in the bucket has a method with the same name as the bucket, e.g. 'save'. A 'save' bucket processes objects by calling each object's `save` method.\n\nObjects that are processed successfully are moved from the bucket. And objects that fail remain in the bucket.\n\nObjects in a bucket may use 'thenable' syntax (promises), and perhaps can move into another bucket depending whether the promise is rejected or resolved.\n\nControl elements (eb-control component) can send an action to the object with the injected bucket service, e.g. a controller. The `SaveBucketMixin` can be used to configure a controller to interact with a `save` bucket. To process a `save` bucket the command is `doSave`; the convention is to prefix the name of the bucket using the word 'do'.\n\nA bucket service can manage many buckets. For example a controller with actions for `save` and `cancel` may call `this.service.doSave()` and `this.service.doRollback()` to process the `save` and `rollback` buckets.\n\nWhen the bucket's contents use promises the call to `doAction` returns a promise that is resolved when all the promies are resolved.\n\nContents of a bucket may be moved to another bucket, for example move items in the 'save' bucket to the 'rollback' bucket then calling `doRollback` to 'cancel' edits that should not be saved.\n\nThe bucket's events can be listened to for responding to processing actions. The events are prefixed with: 'did', 'didNot' and 'didEmpty'. So for a 'save' bucket the events are `didSave`, `didNotSave` and `didEmptySave`. These events are intended to be used for notifications.\n\nIn the examples you will see each component listed and a simple list of models that are members of a 'save' bucket.\n\n## Development Notes\n\nAfter cloning this repo...\n\n1) Install all dependencies with [NPM]\n\n    $ npm install\n\n2) Start your test and development server using [testem]\n\n    $ ./testem\n\n* The [example application][example] runs on same port as testem.\n\nBuild distribution files:\n\n    $ ./grunt dist\n\n\n### Command `./testem`\n\n* A Broccoli server will start and rebuild when it detects code changes\n* Test'em will run tests and automatically re-run the tests each time Broccoli builds\n* The component becomes available at \u003chttp://localhost:7357/examples/index.html\u003e and will automatically reload each time Broccoli builds\n\n### Command `./grunt`\n\n* Broccoli will build the component for testing\n* Test'em will run tests in multiple browsers\n* Broccoli will build the component for distribution in AMD, Named AMD, CJS, and Global module formats (thanks to [Ryan Florence's broccoli-dist-es6-module][es6-dist])\n\n### Thanks (and Links)\n\n* [broccoli] - (speedy) build tool by Jo Liss\n* [es6-dist] - Ryan Florence's broccoli-dist-es6-module\n* [emberella-component-blueprint] - Blueprint for building components by Dana Franklin\n\n[emberella-component-blueprint]: https://github.com/realityendshere/emberella-component-blueprint \"blueprint\"\n[emberella]: https://github.com/realityendshere/emberella \"Emberella\"\n[example]: http://localhost:7357/examples/index.html \"Example Components and App\"\n[es6-dist]: https://github.com/rpflorence/broccoli-dist-es6-module \"broccoli-dist-es6-module\"\n[broccoli]: https://github.com/joliss/broccoli \"Broccoli\"\n[testem]: https://github.com/airportyh/testem \"Test'em 'Scripts!\"\n[NPM]: https://www.npmjs.org \"NPM\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelhandler%2Fember-bucket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixelhandler%2Fember-bucket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelhandler%2Fember-bucket/lists"}