Hello all, I have this ->
import { Filter, FilterSettingsModel, GridComponent, IFilter, Inject } from '@syncfusion/ej2-react-grids'
with
export default class App extends React.Component<{}, {}>{
public Filter : IFilter = {
type: 'CheckBox'
}
public render() {
return <GridComponent dataSource={data} filterSettings={this.FilterOptions}
allowFiltering={true} height={273}>
<ColumnsDirective>
<ColumnDirective field='OrderID' width='100' textAlign="Right"/>
<ColumnDirective field='CustomerID' filter={this.Filter} width='100'/>
<ColumnDirective field='EmployeeID' width='100' textAlign="Right"/>
<ColumnDirective field='Freight' width='100' format="C2" textAlign="Right"/>
<ColumnDirective field='ShipCountry' width='100'/>
</ColumnsDirective>
<Inject services={[Filter]} />
</GridComponent>
}
}
How do I use `services={[Filter]}` with CLJS? IFilter
interface what?hmm is that typescript or what is that?
type
@fabrao I answered your question in #helix . it’s best not to cross post many channels
its just #js [#js {:type "CheckBox"}]
I presume, not actually a clue if typescripts adds anything
many sory
assuming that IFilter
is a TypeScript interface, they have no runtime
yes but the import { Filter }
confuses me? what is that?
I'd assume that the public Filter = { type: "CheckBox" }
is just regular property syntax?
I still know next to nothing about typescript though 😛
@lilactown btw didn't you write something to generate ES class
or did you want to do that?
ahhh I was thrown off by the indentation, I thought that was a part of the type of App
I finally broke down and wrote one myself 😛
oh yeah? lol
this is what I’m using in helix: https://github.com/lilactown/helix/blob/master/src/helix/impl/classes.js
it is not great
(defclass Something
(extends SomethingElse)
(field foo 1)
(field bar)
(constructor [this x]
(super "foo")
(set! bar (+ foo x)))
Object
(someMethod [this foo])
SomeProtocol
(foo [this bar]))
(Something. 1)
generates an actual some.ns.Something = class some$ns$Something { constructor(x) { ... }}
nice. I like it
I had high hopes to create a patch for CLJS to actually emit class
but then life happened. I think someone created a library that does it by extending/altering the compiler at a distance
yeah requires hacking into the compiler quite a bit
https://github.com/thheller/shadow-cljs/commit/106dcda807c048fbe56adaf00f35b7f196113b39
seems to work ok but probably missing a bunch of weird edge cases 😛
I thought you wrote something like this but I guess I misremembered then?
nah it was someone else
happy that it works at all for now
release it as a standalone lib and so I can delete my gross hack in helix 😄
when I feel semi confident that its correct I'll likely do that
until then it'll stay in shadow-cljs
very nice
starting to get sick of React’s shit. might give grove a try sometime this year 😂
got really tired of doing this shit since there was no other way to do stuff in the "constructor"
stay away from grove for now .. I have a few breaking changes coming up 😉
I’m not dropping React anytime soon… or ever. I think I really just want something else to do
grove looks cool.
:picard-facepalm:
lol
the positional args for types/records will never not drive me crazy
typically don't write much of this kind of mutable code but sometimes you just have to 😛
yeah there’s a lot of this in a lib i’ve been working on: https://github.com/lilactown/serenity/blob/clj/src/serenity/core.clj#L191