shoreleave / shoreleave-pubsub Goto Github PK
View Code? Open in Web Editor NEWA smarter client-side with ClojureScript : Shoreleave's publish/subscribe system
License: Eclipse Public License 1.0
A smarter client-side with ClojureScript : Shoreleave's publish/subscribe system
License: Eclipse Public License 1.0
Anyone seeing this error in the browser's console?
I'm using this version below with [org.clojure/clojure "1.5.1"].
[shoreleave/shoreleave-pubsub "0.3.0"]
Uncaught Error: No protocol method IPublishable.publishize defined for type function: function mytest_fn() {
return 5
}
(def bus (simplebus/bus))
(defn mytest-fn [] 5)
(def mytest-fn-p (pubsub/publishize mytest-fn bus))
When I require from the pubsubs namespace:
(ns myapp.client
(:require [shoreleave.pubsubs.simple :as pbus]))
I get a client error on blob.js:46 (from shoreleave-browser dependency):
window.BlobBuilder.prototype.cljs$core$ITransientCollection$ = true;
Uncaught TypeError: Cannot read property 'prototype' of undefined
Calling (publishized? ...) on an Atom will always return a truthy result:
(publishized? [t]
(-> t hash str))
This caused me a bit of consternation as I wanted to avoid double-subscribing to a topic, so I always wrote:
(defn publishize [obj]
(when-not (publishized? obj)
(pubsub/publishize obj bus)))
This obviously won't work, since any atom will return true for publishized?
- though strangely, this worked fine until two days ago. I'm not sure what changed.
Should the implementation for Atoms be similar to others, where we attach a key in the Atom's meta field? Happy to make a PR if so, otherwise would love to understand better.
Thanks for the great libraries!
What about a macro that combines function definition and publishize?
Hi Paul,
I am trying to use the pubsub in shoreleave. Here is the gist of my code - https://gist.github.com/3016422
On loading the page, this is the error I receive in the browser console -
goog.require could not find: goog.storage.mechanism.HTML5LocalStorage
goog.requireclient.js:96
(anonymous function)client.js:20191
client.js:98Uncaught Error: goog.require could not find: goog.storage.mechanism.HTML5LocalStorage
goog.requireclient.js:98
(anonymous function)
However there is no error on compiling of the cljs.
How do I get rid of the error?
Thanks,
murtaza
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.