The guide to migrate away from bs.send.pipe

Hi all,
As you may notice in the latest version of rescript,a deprecation warning is emitted for the usage of bs.send.pipe, how to migrate away from it?

Suppose you have a binding like this

@bs.send.pipe(: array<'a> )
external fillInPlace : 
 'a => array<'a> = "fill"

change it to

@send
external fillInPlace : 
 (array<'a>,'a) => array<'a> = "fill" 

let fillInPlace = (arg,obj)=> obj->fillInPlace(arg)

That’s all you need, if you have more time, I would suggest to just use the t-first API, so no need to wrap filInPlace any more.

Let me know if you have any question, thanks!

5 Likes

What is the t-first API? Feel like I should read that doc.

Thank you.

1 Like

Hope some day, all Js. will be merge in only one Belt. namespace :weary:

1 Like