Coder Social home page Coder Social logo

archedatajs's Introduction

ArcheDataJs

A simple implementation of a notifying data storage framework in javascript

This library provides a simple data management framework that implements a few features:

Initialization from archetypes

Data creation begins with an archetype definition that is simply an object that will serve as a base object that can be created and stored in the respoitory. This allows for strict data control as the objects are created and selaed so that there is no way to alter the objects after creation. The motivation for this is to enable central control of data graphs and prevent unnecessary data to be added to the model.

State tracking

All nodes defined on the archetype object are tracked as pristine or modified and maintained as they are updated. This allows for the creation of a diff object.

Change Notification

All nodes defined on the archetype objects support the registration of callbacks that will fire with a change object when the object changes. By setting a function on the property to watch that callback will be fired with a change object when the object changes.

ToDo

There are features still to be implemented such as:

  • Re initialization of the tree
  • Auto creation of diff objects
  • Notification on parent objects on deletes and adds of children

Usage

To run the tests, just do a bower install and open the SpecRunner in chrome.

To use the library, just include the dataStore.js file and use the DataStore object on the global scope.

Background

The motivation of this project was to use the javascript Object.defineProperty prototype function to implement a change tracking and notification system for data trees. Data management across large projects can be a difficult thing to do successfully and this is my attempt at solving some of these issues based on experiences from large angular applications with big trees of data.

archedatajs's People

Contributors

bradpearson avatar

Watchers

 avatar

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.