Coder Social home page Coder Social logo

re-frame's Introduction

pure-frame: a re-frame fork

By deleting this repo I would break links in PR #107.


Build Status

This is a fork of re-frame originated in PR #107

My initial goal was to allow multiple re-frame instances hosted in a single javascript context. But during rewrite I realized that proper decoupling of re-frame from reagent and core.async will be useful for other scenarios as well. For example with pure-frame you can easily replace router-loop or implement underlying storage for app-db in a different way.

I ended up implementing re-frame instance as a value with a set of pure functions to transform it. Event processor is expressed as a tranducer which allows great flexibility.

In your project you should require re-frame.frame and call make-frame to create your own re-frame instance(s).

For backward compatibility you can require re-frame.core you get compatible interface to the re-frame v0.4.1. In v041.cljs you can see how was old re-frame implemented on top of re-frame.frame:

  • there is one global app-db and one global app-frame
  • app-db is backed by reagent/atom
  • app-frame has default loggers
  • router event queue is implemented using core.async channel
  • familiar original re-frame api shim is provided in re-frame.core

I decided to remove some functionality of original re-frame, because I don't personally use it and didn't want to port it over:

  • removed undoable middleware and related functionality
  • removed pure middleware, because it makes no sense in the new model
  • removed some sanity checks of wrong usage of middle-ware factories to simplify the code a bit

Also I have added some tests.

re-frame's People

Contributors

mike-thompson-day8 avatar darwin avatar stumitchell avatar hipitihop avatar danielcompton avatar gregg8 avatar estsauver avatar ricardojmendez avatar ducky427 avatar djebbz avatar ku1ik avatar marxama avatar sitepodmatt avatar sir-pinecone avatar smahood avatar thenonameguy avatar zto avatar moohdyy avatar

Stargazers

Ruslan Prakapchuk avatar

Watchers

James Cloos avatar  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.