GithubHelp home page GithubHelp logo

niwinz / cljs-bean Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mfikes/cljs-bean

0.0 0.0 0.0 132 KB

Efficient JavaScript object interop via idiomatic ClojureScript

License: Eclipse Public License 1.0

Clojure 100.00%

cljs-bean's Introduction

CLJS Bean

Like clojure.core/bean, but for ClojureScript.

Clojars Project cljdoc badge Build Status

A bean function and ->clj and ->js converters enable working with JavaScript objects via thin wrappers implementing ClojureScript collection abstractions:

(require '[cljs-bean.core :refer [bean ->clj ->js]])

(bean #js {:a 1, :b 2})
;; {:a 1, :b 2}

The converters enable idiomatic interop while being much faster than equivalent constructs using js->clj and clj->js:

(let [{:keys [a b]} (->clj #js {:a 1, :b 2})]
  (+ a b))
;; => 3
  
(into (->clj #js [1 2]) [3 4 5])
;; [1 2 3 4 5]

(->js *1)
;; #js [1 2 3 4 5]

Read more:

Overview

Object Extraction

Recursive Beans

Key Mapping

Transit

License

Copyright ยฉ 2019โ€“2022 Mike Fikes

Distributed under the EPL License, same as Clojure. See LICENSE.

The namespace cljs-bean.from.cljs.core contains source from ClojureScript which is licensed under the EPL license.

cljs-bean's People

Contributors

mfikes 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.